Part Number Hot Search : 
CMHZ4695 24010 CENW57 5ACD2T HD6433 D100B 3USB3 BF1211WR
Product Description
Full Text Search
 

To Download MC68EN360CRC25 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  mc68360 quad integrated communications controller user? manual motorola reserves the right to make changes without further notice to any products herein to improve reliability, function or design. motorola does not assume any liability arising out of the application or use of any product or circuit described herein; neither does it convey any license under its patent rights nor the rights of others. motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the motorola product could create a situation where personal injury or death may occur. should buyer purchase or use motorola products for any such unintended or unauthorized application, buyer shall indemnify and hold motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that motorola was negligent regarding the design or manufacture of the part. motorola and the are registered trademarks of motorola, inc. motorola, inc. is an equal opportunity/affirmative action employer. motorola
ii mc68360 user? manual motorola
motorola mc68360 user? manual iii preface the complete documentation package for the mc68360 consists of the mc68360um/ad, mc68360 quad integrated communications controller user? manual , m68000pm/ad, mc68000 family programmer? reference manual, and the mc68360/d, mc68360 quad integrated communications controller product brief . the mc68360 quad integrated communications controller user? manual describes the programming, capabilities, registers, and operation of the mc68360 and the mc68en360; the mc68000 family programmer? reference manual provides instruction details for the mc68360; and the mc68360 quad integrated communications controller product brief provides a brief description of the mc68360 capabilities. this user? manual is organized as follows: section 1 introduction section 2 signal descriptions section 3 memory map section 4 bus operation section 5 cpu32+ section 6 system integration module (sim60) section 7 communication processor module (cpm) section 8 ieee 1149.1 test access port section 9 applications section 10 electrical characteristics section 11 ordering information and mechanical data appendix a serial performance appendix b development tools and support appendix c risc microcode from ram appendix d mc68mh360 product brief
iv mc68360 user? manual motorola
table of contents paragraph title page number number motorola mc68360 user? manual i section 1 introduction 1.1 quicc key features .............................................................................. 1-1 1.2 quicc architecture overview................................................................. 1-4 1.2.1 cpu32+ core.......................................................................................... 1-5 1.2.2 system integration module (sim60)........................................................ 1-5 1.2.3 communications processor module (cpm) ............................................ 1-6 1.3 upgrading designs from the mc68302 ................................................... 1-6 1.3.1 architectural approach ............................................................................ 1-6 1.3.2 hardware compatibility issues................................................................ 1-7 1.3.3 software compatibility issues ................................................................. 1-7 1.4 quicc glueless system design............................................................. 1-8 1.5 quicc serial configurations .................................................................. 1-9 1.6 quicc serial configuration examples ................................................. 1-16 1.7 quicc system bus configurations ...................................................... 1-17 section 2 signal descriptions 2.1 system bus signal index ........................................................................ 2-1 2.1.1 address bus ............................................................................................ 2-1 2.1.1.1 address bus (a27?0)............................................................................ 2-1 2.1.1.2 address bus (a31?28).......................................................................... 2-1 2.1.2 function codes (fc3?c0) .................................................................... 2-5 2.1.3 data bus.................................................................................................. 2-5 2.1.3.1 data bus (d31?16). .............................................................................. 2-5 2.1.3.2 data bus (d15?0). ................................................................................ 2-6 2.1.4 parity ....................................................................................................... 2-6 2.1.4.1 parity (prty0). ....................................................................................... 2-6 2.1.4.2 parity (prty1). ....................................................................................... 2-6 2.1.4.3 parity (prty2). ....................................................................................... 2-6 2.1.4.4 parity (prty3). ....................................................................................... 2-6 2.1.5 memory controller................................................................................... 2-6 2.1.5.1 chip select/row address select (cs6?s0/ras6?as0) ................... 2-6 2.1.5.2 chip select/row address select/interrupt acknowledge (cs7/ras7/iack7). 2-6 2.1.5.3 column address select/interrupt acknowledge (cas3?as0/iack6, 3, 2, 1). 2-7 2.1.5.4 address multiplex (amux). ..................................................................... 2-7 2.1.6 interrupt request level (irq7?rq1)..................................................... 2-7 2.1.7 bus control signals................................................................................. 2-7 2.1.7.1 data and size acknowledge (dsack1?sack0). ................................ 2-8 2.1.7.2 autovector/interrupt acknowledge (avec/iack5).................................. 2-8 2.1.7.3 address strobe (as). .............................................................................. 2-8 2.1.7.4 data strobe (ds)..................................................................................... 2-8 thi d t t d ith f m k 4 0 4
table of contents paragraph title page number number ii mc68360 user? manual motorola 2.1.7.5 transfer size (siz1, siz0). ......................................................................2-8 2.1.7.6 read/write (r/w).....................................................................................2-8 2.1.7.7 output enable/address multiplex (oe/amux).........................................2-9 2.1.7.8 byte write enable (we3?e0). ..............................................................2-9 2.1.8 bus arbitration signals.............................................................................2-9 2.1.8.1 bus request (br). ...................................................................................2-9 2.1.8.2 bus grant (bg). .......................................................................................2-9 2.1.8.3 bus grant acknowledge (bgack). .........................................................2-9 2.1.8.4 read-modify-write cycle/initial configuration (rmc/config0).............2-9 2.1.8.5 bus clear out/initial configuration/row address select double-drive (bcl- ro/config1/ras2dd).2-9 2.1.9 system control signals..........................................................................2-10 2.1.9.1 soft reset (resets). ...........................................................................2-10 2.1.9.2 hard reset (reseth)...........................................................................2-10 2.1.9.3 halt (halt). ...........................................................................................2-10 2.1.9.4 bus error (berr). .................................................................................2-10 2.1.10 clock signals .........................................................................................2-10 2.1.10.1 system clock outputs (clko2?lko1). .............................................2-10 2.1.10.2 crystal oscillator (extal, xtal). .........................................................2-11 2.1.10.3 external filter capacitor (xfc)..............................................................2-11 2.1.10.4 clock mode select (modck1?odck0).............................................2-11 2.1.11 instrumentation and emulation signals .................................................2-11 2.1.11.1 instruction fetch/development serial input (ifetch/dsi)....................2-11 2.1.11.2 instruction pipe/development serial output ( ipipe0/dso )...................2-11 2.1.11.3 instruction pipe/row address select double-drive ( ipipe1/ras1dd ).2-11 2.1.11.4 breakpoint/development serial clock (bkpt/dsclk). .........................2-11 2.1.11.5 freeze/initial configuration (freeze/config2). ................................2-12 2.1.12 test signals ...........................................................................................2-12 2.1.12.1 tri-state signal (tris). ........................................................................2-12 2.1.12.2 test reset (trst).................................................................................2-12 2.1.12.3 test clock (tck). ..................................................................................2-12 2.1.12.4 test mode select (tms). .......................................................................2-12 2.1.12.5 test data in (tdi). .................................................................................2-12 2.1.12.6 test data out (tdo)..............................................................................2-12 2.1.13 initial configuration pins (config).......................................................2-12 2.1.14 power signals ........................................................................................2-13 2.1.14.1 vccsyn and gndsyn.........................................................................2-13 2.1.14.2 vccclk and gndclk. ........................................................................2-13 2.1.14.3 gnds1 and gnds2. .............................................................................2-13 2.1.14.4 vcc and gnd. ......................................................................................2-13 2.1.14.5 nc4?c1...............................................................................................2-13 2.2 system bus signal index in slave mode ...............................................2-14 2.3 on-chip peripherals signal index..........................................................2-15 section 3
table of contents paragraph title page number number motorola mc68360 user? manual iii quicc memory map 3.1 dual-port ram memory map .................................................................. 3-2 3.2 cpm sub-module base addresses......................................................... 3-3 3.3 internal registers memory map .............................................................. 3-4 3.3.1 sim registers memory map.................................................................... 3-4 3.3.2 cpm registers memory map .................................................................. 3-6 section 4 bus operation 4.1 bus transfer signals ............................................................................... 4-2 4.1.1 bus control signals................................................................................. 4-3 4.1.2 function codes (fc3?c0) .................................................................... 4-3 4.1.3 address bus (a31?0)............................................................................ 4-4 4.1.4 address strobe (as) ............................................................................... 4-4 4.1.5 data bus (d31-d0).................................................................................. 4-4 4.1.6 data strobe (ds)..................................................................................... 4-4 4.1.7 output enable (oe)................................................................................. 4-4 4.1.8 byte write enable (we0, we1, we2, we3) ........................................... 4-4 4.1.9 bus cycle termination signals ............................................................... 4-5 4.1.9.1 data transfer and size acknowledge (dsack1 and dsack0). .............. 4-5 4.1.9.2 bus error (berr).................................................................................... 4-5 4.1.9.3 autovector (avec). ................................................................................. 4-6 4.2 data transfer mechanism ....................................................................... 4-6 4.2.1 dynamic bus sizing ................................................................................ 4-6 4.2.2 misaligned operands ............................................................................ 4-11 4.2.3 effects of dynamic bus sizing and operand misalignment .................. 4-19 4.2.4 bus operation ....................................................................................... 4-20 4.2.5 synchronous operation with dsackx .................................................. 4-21 4.2.6 fast termination cycles........................................................................ 4-21 4.3 data transfer cycles............................................................................. 4-22 4.3.1 read cycle............................................................................................ 4-23 4.3.2 write cycle ............................................................................................ 4-26 4.3.3 read-modify-write cycle ...................................................................... 4-28 4.4 cpu space cycles................................................................................ 4-31 4.4.1 breakpoint acknowledge cycle............................................................. 4-31 4.4.2 lpstop broadcast cycle ..................................................................... 4-35 4.4.3 module base address register (mbar) access .................................. 4-36 4.4.4 interrupt acknowledge bus cycles........................................................ 4-36 4.4.4.1 interrupt acknowledge cycle?erminated normally............................ 4-36 4.4.4.2 autovector interrupt acknowledge cycle. ............................................. 4-38 4.4.4.3 spurious interrupt cycle........................................................................ 4-40 4.5 bus exception control cycles ............................................................... 4-41 4.5.1 bus errors ............................................................................................. 4-42 4.5.2 retry operation ..................................................................................... 4-44 4.5.3 halt operation ....................................................................................... 4-46 4.5.4 double bus fault................................................................................... 4-48
table of contents paragraph title page number number iv mc68360 user? manual motorola 4.6 bus arbitration .......................................................................................4-49 4.6.1 bus request ..........................................................................................4-52 4.6.2 bus grant...............................................................................................4-53 4.6.3 bus grant acknowledge ........................................................................4-53 4.6.4 bus arbitration control...........................................................................4-54 4.6.5 slave (disable cpu32+) mode bus arbitration .....................................4-55 4.6.6 slave (disable cpu32+) mode bus exceptions ....................................4-59 4.6.6.1 halt......................................................................................................4-59 4.6.6.2 retry...................................................................................................4-59 4.6.7 internal accesses...................................................................................4-59 4.6.8 show cycles ..........................................................................................4-62 4.7 reset operation.....................................................................................4-63 section 5 cpu32+ 5.1 overview ..................................................................................................5-1 5.1.1 features...................................................................................................5-2 5.1.2 loop mode instruction execution.............................................................5-3 5.1.3 vector base register ...............................................................................5-4 5.1.4 exception handling ..................................................................................5-4 5.1.5 addressing modes ...................................................................................5-5 5.2 architecture summary .............................................................................5-5 5.2.1 programming model.................................................................................5-6 5.2.2 registers..................................................................................................5-7 5.3 instruction set ..........................................................................................5-8 5.3.1 m68000 family compatibility.................................................................5-10 5.3.1.1 new instructions. ...................................................................................5-10 5.3.1.2 low-power stop (lpstop). ..................................................................5-10 5.3.1.3 table lookup and interpolate (tbl). .....................................................5-10 5.3.1.4 unimplemented instructions. .................................................................5-10 5.3.2 instruction format and notation.............................................................5-10 5.3.3 instruction summary ..............................................................................5-13 5.3.3.1 condition code register........................................................................5-17 5.3.3.2 data movement instructions ..................................................................5-19 5.3.3.3 integer arithmetic operations ................................................................5-19 5.3.3.4 logic instructions. ..................................................................................5-21 5.3.3.5 shift and rotate instructions..................................................................5-22 5.3.3.6 bit manipulation instructions ..................................................................5-23 5.3.3.7 binary-coded decimal (bcd) instructions.............................................5-24 5.3.3.8 program control instructions .................................................................5-24 5.3.3.9 system control instructions ...................................................................5-25 5.3.3.10 condition tests ......................................................................................5-26 5.3.4 using the tbl instructions.....................................................................5-27 5.3.4.1 table example 1: standard usage ........................................................5-28 5.3.4.2 table example 2: compressed table....................................................5-29
table of contents paragraph title page number number motorola mc68360 user? manual v 5.3.4.3 table example 3: 8-bit independent variable....................................... 5-30 5.3.4.4 table example 4: maintaining precision ............................................... 5-32 5.3.4.5 table example 5: surface interpolations .............................................. 5-33 5.3.5 nested subroutine calls........................................................................ 5-33 5.3.6 pipeline synchronization with the nop instruction ............................... 5-34 5.4 processing states ................................................................................. 5-34 5.4.1 state transitions ................................................................................... 5-34 5.4.2 privilege levels ..................................................................................... 5-34 5.4.2.1 supervisor privilege level..................................................................... 5-35 5.4.2.2 user privilege level .............................................................................. 5-35 5.4.2.3 changing privilege level....................................................................... 5-35 5.5 exception processing............................................................................ 5-36 5.5.1 exception vectors ................................................................................. 5-36 5.5.1.1 types of exceptions .............................................................................. 5-36 5.5.1.2 exception processing sequence........................................................... 5-38 5.5.1.3 exception stack frame ......................................................................... 5-38 5.5.1.4 multiple exceptions ............................................................................... 5-39 5.5.2 processing of specific exceptions ........................................................ 5-40 5.5.2.1 reset ..................................................................................................... 5-40 5.5.2.2 bus error ............................................................................................... 5-40 5.5.2.3 address error ........................................................................................ 5-42 5.5.2.4 instruction traps.................................................................................... 5-42 5.5.2.5 software breakpoints ............................................................................ 5-43 5.5.2.6 hardware breakpoints........................................................................... 5-43 5.5.2.7 format error .......................................................................................... 5-43 5.5.2.8 illegal or unimplemented instructions ................................................... 5-44 5.5.2.9 privilege violations ................................................................................ 5-44 5.5.2.10 tracing .................................................................................................. 5-45 5.5.2.11 interrupts ............................................................................................... 5-46 5.5.2.12 return from exception........................................................................... 5-47 5.5.3 fault recovery ...................................................................................... 5-48 5.5.3.1 types of faults...................................................................................... 5-51 5.5.3.1.1 type i?eleased write faults ............................................................. 5-51 5.5.3.1.2 type ii?refetch, operand, rmw, and movep faults....................... 5-51 5.5.3.1.3 type iii?aults during movem operand transfer ............................. 5-52 5.5.3.1.4 type iv?aults during exception processing ..................................... 5-52 5.5.3.2 correcting a fault.................................................................................. 5-53 5.5.3.2.1 type i?ompleting released writes via software .............................. 5-53 5.5.3.2.2 type i?ompleting released writes via rte ..................................... 5-53 5.5.3.2.3 type ii?orrecting faults via rte....................................................... 5-54 5.5.3.2.4 type iii?orrecting faults via software............................................... 5-54 5.5.3.2.5 type iii?orrecting faults by conversion and restart........................ 5-55 5.5.3.2.6 type iii?orrecting faults via rte...................................................... 5-55 5.5.3.2.7 type iv?orrecting faults via software .............................................. 5-55 5.5.4 cpu32+ stack frames ......................................................................... 5-56
table of contents paragraph title page number number vi mc68360 user? manual motorola 5.5.4.1 four-word stack frame ........................................................................5-56 5.5.4.2 six-word stack frame...........................................................................5-56 5.5.4.3 bus error stack frame ..........................................................................5-56 5.6 development support ............................................................................5-59 5.6.1 cpu32+ integrated development support ............................................5-59 5.6.1.1 background debug mode (bdm) overview...........................................5-59 5.6.1.2 deterministic opcode tracking overview..............................................5-60 5.6.1.3 on-chip hardware breakpoint overview...............................................5-60 5.6.2 background debug mode ......................................................................5-60 5.6.2.1 enabling bdm ........................................................................................5-60 5.6.2.2 bdm sources.........................................................................................5-61 5.6.2.2.1 external bkpt signal ............................................................................5-62 5.6.2.2.2 bgnd instruction ...................................................................................5-62 5.6.2.2.3 double bus fault ...................................................................................5-62 5.6.2.3 entering bdm.........................................................................................5-62 5.6.2.4 command execution..............................................................................5-62 5.6.2.5 bdm registers.......................................................................................5-63 5.6.2.5.1 fault address register (far)................................................................5-63 5.6.2.5.2 return program counter (rpc).............................................................5-63 5.6.2.5.3 current instruction program counter (pcc)..........................................5-63 5.6.2.6 returning from bdm ..............................................................................5-63 5.6.2.7 serial interface.......................................................................................5-63 5.6.2.7.1 cpu serial logic....................................................................................5-65 5.6.2.7.2 development system serial logic .........................................................5-66 5.6.2.8 command set ........................................................................................5-68 5.6.2.8.1 command format ..................................................................................5-68 5.6.2.8.2 command sequence diagram...............................................................5-69 5.6.2.8.3 command set summary........................................................................5-69 5.6.2.8.4 read a/d register (rareg/rdreg)...................................................5-71 5.6.2.8.5 write a/d register (wareg/wdreg) .................................................5-71 5.6.2.8.6 read system register (rsreg)...........................................................5-71 5.6.2.8.7 write system register (wsreg) ..........................................................5-72 5.6.2.8.8 read memory location (read) ............................................................5-73 5.6.2.8.9 write memory location (write) ...........................................................5-74 5.6.2.8.10 dump memory block (dump)................................................................5-75 5.6.2.8.11 fill memory block (fill) ........................................................................5-76 5.6.2.8.12 resume execution (go)........................................................................5-77 5.6.2.8.13 call user code (call) ..........................................................................5-77 5.6.2.8.14 reset peripherals (rst)........................................................................5-79 5.6.2.8.15 no operation (nop) ..............................................................................5-79 5.6.2.8.16 future commands .................................................................................5-80 5.6.3 deterministic opcode tracking..............................................................5-80 5.6.3.1 instruction fetch (ifetch) ....................................................................5-80 5.6.3.2 instruction pipe (ipipe1?pipe0) ..........................................................5-80 5.6.3.3 opcode tracking during loop mode......................................................5-82
table of contents paragraph title page number number motorola mc68360 user? manual vii 5.7 instruction execution timing ................................................................. 5-82 5.7.1 resource scheduling ............................................................................ 5-83 5.7.1.1 microsequencer..................................................................................... 5-83 5.7.1.2 instruction pipeline ................................................................................ 5-83 5.7.1.3 bus controller resources ..................................................................... 5-83 5.7.1.3.1 prefetch controller ................................................................................ 5-84 5.7.1.3.2 write-pending buffer ............................................................................. 5-84 5.7.1.3.3 microbus controller ............................................................................... 5-85 5.7.1.4 instruction execution overlap ............................................................... 5-85 5.7.1.5 effects of wait states ............................................................................ 5-86 5.7.1.6 instruction execution time calculation ................................................. 5-86 5.7.1.7 effects of negative tails........................................................................ 5-87 5.7.2 instruction timing tables ...................................................................... 5-88 5.7.2.1 fetch effective address ........................................................................ 5-90 5.7.2.2 calculate effective address .................................................................. 5-91 5.7.2.3 move instruction .................................................................................. 5-92 5.7.2.4 special-purpose move instruction....................................................... 5-92 5.7.2.5 arithmetic/logic instructions ................................................................. 5-93 5.7.2.6 immediate arithmetic/logic instructions................................................ 5-95 5.7.2.7 binary-coded decimal and extended instructions................................ 5-95 5.7.2.8 single operand instructions .................................................................. 5-96 5.7.2.9 shift/rotate instructions ........................................................................ 5-96 5.7.2.10 bit manipulation instructions ................................................................. 5-97 5.7.2.11 conditional branch instructions............................................................. 5-98 5.7.2.12 control instructions ............................................................................... 5-99 5.7.2.13 exception-related instructions and operations .................................. 5-100 5.7.2.14 save and restore operations ............................................................. 5-101 section 6 system integration module (sim60) 6.1 module overview..................................................................................... 6-1 6.2 module base address register (mbar) ................................................. 6-3 6.3 system configuration and protection...................................................... 6-3 6.3.1 system configuration .............................................................................. 6-5 6.3.1.1 sim60 interrupt generation..................................................................... 6-6 6.3.1.2 simultaneous sim60 interrupt sources................................................... 6-8 6.3.1.2.1 bus monitor ............................................................................................. 6-8 6.3.1.2.2 spurious interrupt monitor....................................................................... 6-8 6.3.1.2.3 double bus fault monitor........................................................................ 6-9 6.3.1.2.4 software watchdog timer (swt) ........................................................... 6-9 6.3.2 periodic interrupt timer (pit)................................................................ 6-10 6.3.2.1 pit period calculation........................................................................... 6-10 6.3.2.2 using the pit as a real-time clock ..................................................... 6-11 6.3.3 freeze support...................................................................................... 6-11 6.3.4 low-power stop support ...................................................................... 6-11 6.4 low power in normal operation ........................................................... 6-12
table of contents paragraph title page number number viii mc68360 user? manual motorola 6.5 sim60 system clock generation...........................................................6-12 6.5.1 clock generation methods ....................................................................6-12 6.5.2 oscillator prescaler (divide by 128).......................................................6-13 6.5.3 phase-locked loop (pll) .....................................................................6-14 6.5.3.1 frequency multiplication ........................................................................6-14 6.5.3.2 skew elimination....................................................................................6-15 6.5.4 low-power divider.................................................................................6-15 6.5.5 quicc internal clock signals................................................................6-15 6.5.5.1 spclk ...................................................................................................6-16 6.5.5.2 general system clock ...........................................................................6-16 6.5.5.3 brgclk ................................................................................................6-17 6.5.5.4 syncclk ................................................................................................6-17 6.5.5.5 simclk..................................................................................................6-18 6.5.5.6 clko1 ...................................................................................................6-18 6.5.5.7 clko2 ...................................................................................................6-18 6.5.6 pll power pins .....................................................................................6-19 6.5.6.1 vccsyn ................................................................................................6-19 6.5.6.2 gndsyn................................................................................................6-19 6.5.6.3 xfc........................................................................................................6-19 6.5.7 clko power pins ..................................................................................6-19 6.5.7.1 vccclk ................................................................................................6-19 6.5.7.2 gndclk ................................................................................................6-19 6.5.8 configuration pins (modck1?odck0) .............................................6-19 6.6 breakpoint logic ....................................................................................6-20 6.7 external bus interface control ...............................................................6-21 6.7.1 initial configuration ................................................................................6-22 6.7.2 port d.....................................................................................................6-22 6.7.3 port e .....................................................................................................6-23 6.8 slave (disable cpu32+) mode ..............................................................6-23 6.8.1 mbar in a multiple quicc system.......................................................6-24 6.8.2 global chip select (cs0) in slave mode ...............................................6-25 6.8.3 bus clear in slave mode .......................................................................6-25 6.8.4 interrupts in slave mode ........................................................................6-26 6.8.5 pin differences in slave mode...............................................................6-26 6.8.6 other functionality in slave mode .........................................................6-27 6.9 programmer? model..............................................................................6-27 6.9.1 module base address register (mbar)................................................6-27 6.9.2 module base address register enable (mbare) .................................6-29 6.9.3 system configuration and protection registers ....................................6-29 6.9.3.1 module configuration register (mcr)...................................................6-29 6.9.3.2 autovector register (avr).....................................................................6-34 6.9.3.3 reset status register (rsr) .................................................................6-34 6.9.3.4 software watchdog interrupt vector register (swiv)...........................6-35 6.9.3.5 system protection control register (sypcr) .......................................6-35 6.9.3.6 periodic interrupt control register (picr).............................................6-37
table of contents paragraph title page number number motorola mc68360 user? manual ix 6.9.3.7 periodic interrupt timer register (pitr)............................................... 6-38 6.9.3.8 software service register (swsr)....................................................... 6-39 6.9.3.9 clko control register (clkocr) ....................................................... 6-39 6.9.3.10 pll control register (pllcr) .............................................................. 6-40 6.9.3.11 clock divider control register (cdvcr) .............................................. 6-42 6.9.3.12 breakpoint address register (bkar) ................................................... 6-44 6.9.3.13 breakpoint control register (bkcr)..................................................... 6-44 6.9.4 port e pin assignment register (pepar) ............................................ 6-48 6.10 memory controller................................................................................. 6-50 6.10.1 memory controller key features .......................................................... 6-50 6.10.2 memory controller overview................................................................. 6-51 6.11 general-purpose chip-select overview (sram banks)....................... 6-56 6.11.1 associated registers............................................................................. 6-56 6.11.2 8-, 16-, and 32-bit port size configuration............................................ 6-56 6.11.3 write protect configuration ................................................................... 6-56 6.11.4 programmable wait state configuration............................................... 6-56 6.11.5 address and address space checking................................................. 6-57 6.11.6 sram bank parity................................................................................. 6-57 6.11.7 external master support........................................................................ 6-57 6.11.8 global (boot) chip-select operation..................................................... 6-58 6.11.9 sram bus error.................................................................................... 6-58 6.12 dram controller overview (dram banks) .......................................... 6-58 6.12.1 dram normal access support ............................................................. 6-60 6.12.2 dram page mode support................................................................... 6-60 6.12.3 dram burst access support ................................................................ 6-61 6.12.4 dram bank parity ................................................................................ 6-62 6.12.5 refresh operation ................................................................................. 6-62 6.12.6 dram bank external master support................................................... 6-63 6.12.7 double-drive ras lines ....................................................................... 6-63 6.12.8 dram bus error.................................................................................... 6-63 6.13 programming model .............................................................................. 6-64 6.13.1 global memory register (gmr)............................................................ 6-64 6.13.2 memory controller status register (mstat)........................................ 6-69 6.13.3 base register (br) ............................................................................... 6-70 6.13.4 option register (or)............................................................................. 6-74 6.13.5 dram-sram performance summary; ................................................. 6-78 section 7 communication processor module (cpm) introduction.............................................................................................. 7-1 7.1 risc controller ....................................................................................... 7-3 7.1.1 risc controller configuration register (rccr).................................... 7-4 7.1.2 risc microcode revision number......................................................... 7-5 7.2 command set ........................................................................................ 7-5 7.2.1 command register examples................................................................. 7-8 7.2.2 command execution latency ................................................................. 7-8
table of contents paragraph title page number number x mc68360 user? manual motorola 7.3 dual-port ram.........................................................................................7-8 7.3.1 buffer descriptors ..................................................................................7-10 7.3.2 parameter ram .....................................................................................7-10 7.4 risc timer tables ................................................................................7-11 7.4.1 risc timer table parameter ram .......................................................7-12 7.4.2 risc timer table entries ......................................................................7-14 7.4.3 risc timer event register (rter) ......................................................7-14 7.4.4 risc timer mask register (rtmr) ......................................................7-14 7.4.5 set timer command ..........................................................................7-14 7.4.6 risc timer initialization sequence .......................................................7-14 7.4.7 risc timer initialization example .........................................................7-15 7.4.8 risc timer interrupt handling..............................................................7-16 7.4.9 risc timer table algorithm .................................................................7-16 7.4.10 risc timer table application: track the risc loading .......................7-16 7.5 timers ...................................................................................................7-17 7.5.1 timer key features ...............................................................................7-17 7.5.2 general-purpose timer units ...............................................................7-18 7.5.2.1 cascaded mode.....................................................................................7-19 7.5.2.2 timer global configuration register (tgcr) ........................................7-20 7.5.2.3 timer mode register (tmr1, tmr2, tmr3, tmr4).............................7-21 7.5.2.4 timer reference registers (trr1, trr2, trr3, trr4) .....................7-22 7.5.2.5 timer capture registers (tcr1, tcr2, tcr3, tcr4).........................7-22 7.5.2.6 timer counter (tcn1, tcn2, tcn3, tcn4) .........................................7-22 7.5.2.7 timer event registers (ter1, ter2, ter3, ter4) .............................7-22 7.5.3 timer examples .....................................................................................7-23 7.6 idma channels......................................................................................7-24 7.6.1 idma key features;..............................................................................7-25 7.6.2 idma registers.....................................................................................7-26 7.6.2.1 idma channel configuration register (iccr).......................................7-26 7.6.2.2 channel mode register (cmr)..............................................................7-28 7.6.2.3 source address pointer register (sapr) .............................................7-30 7.6.2.4 destination address pointer register (dapr).......................................7-31 7.6.2.5 function code register (fcr) ..............................................................7-31 7.6.2.6 byte count register (bcr)....................................................................7-31 7.6.2.7 channel status register (csr) .............................................................7-32 7.6.2.8 channel mask register (cmar)............................................................7-33 7.6.2.9 data holding register (dhr).................................................................7-33 7.6.3 interface signals ...................................................................................7-33 7.6.3.1 dreq and dack...................................................................................7-33 7.6.3.2 donex...................................................................................................7-33 7.6.4 idma operation ....................................................................................7-34 7.6.4.1 single buffer ..........................................................................................7-34 7.6.4.2 auto buffer and buffer chaining ............................................................7-34 7.6.4.2.1 idma parameter ram ...........................................................................7-35 7.6.4.2.2 idma buffer descriptors (bds) ..............................................................7-36
table of contents paragraph title page number number motorola mc68360 user? manual xi 7.6.4.2.3 idma commands (init_idma)............................................................. 7-38 7.6.4.3 starting the idma .................................................................................. 7-38 7.6.4.4 requesting idma transfers .................................................................. 7-39 7.6.4.4.1 internal maximum rate ......................................................................... 7-39 7.6.4.4.2 internal limited rate ............................................................................. 7-39 7.6.4.4.3 external burst mode.............................................................................. 7-40 7.6.4.4.4 external cycle steal .............................................................................. 7-42 7.6.4.5 idma bus arbitration............................................................................. 7-43 7.6.4.6 idma operand transfers ...................................................................... 7-45 7.6.4.6.1 dual address mode............................................................................... 7-45 7.6.4.6.2 single address mode (flyby transfers) ................................................ 7-48 7.6.4.6.3 fast-termination option........................................................................ 7-50 7.6.4.6.4 externally recognizing idma operand transfers................................. 7-51 7.6.4.7 bus exceptions...................................................................................... 7-51 7.6.4.7.1 reset ..................................................................................................... 7-51 7.6.4.7.2 bus error ............................................................................................... 7-51 7.6.4.7.3 retry...................................................................................................... 7-51 7.6.4.8 ending the idma transfer..................................................................... 7-52 7.6.4.8.1 single buffer mode termination............................................................ 7-52 7.6.4.8.2 auto buffer mode termination. ............................................................. 7-53 7.6.4.8.3 buffer chaining mode termination........................................................ 7-54 7.6.5 idma examples.................................................................................... 7-55 7.6.5.1 single buffer examples ......................................................................... 7-55 7.6.5.2 buffer chaining example....................................................................... 7-55 7.6.5.3 auto buffer example ............................................................................. 7-56 7.7 sdma channels.................................................................................... 7-57 7.7.1 sdma bus arbitration and bus transfers ............................................. 7-57 7.7.2 sdma registers.................................................................................... 7-59 7.7.2.1 sdma configuration register (sdcr).................................................. 7-59 7.7.2.2 sdma status register (sdsr) ............................................................. 7-61 7.7.2.3 sdma address register (sdar) .......................................................... 7-61 7.8 serial interface with time slot assigner................................................ 7-62 7.8.1 si key features.................................................................................... 7-62 7.8.2 tsa overview ...................................................................................... 7-64 7.8.3 enabling connections to the tsa ........................................................ 7-67 7.8.4 si ram ................................................................................................. 7-68 7.8.4.1 one multiplexed channel with static frames ....................................... 7-69 7.8.4.2 one multiplexed channel with dynamic frames .................................. 7-69 7.8.4.3 two multiplexed channels with static frames...................................... 7-70 7.8.4.4 two multiplexed channels with dynamic frames................................. 7-71 7.8.4.5 programming si ram entries ............................................................... 7-72 7.8.4.6 si ram programming example ............................................................ 7-75 7.8.4.7 si ram dynamic changes.................................................................... 7-75 7.8.5 si registers........................................................................................... 7-77 7.8.5.1 si global mode register (sigmr) ........................................................ 7-77
table of contents paragraph title page number number xii mc68360 user? manual motorola 7.8.5.2 si mode register (simode)..................................................................7-78 7.8.5.3 si clock route register (sicr).............................................................7-86 7.8.5.4 si command register (sicmr).............................................................7-87 7.8.5.5 si status register (sistr) ....................................................................7-87 7.8.5.6 si ram pointers (sirp).........................................................................7-88 7.8.5.6.1 sirp when rdm = 00 (one static tdm) ..............................................7-89 7.8.5.6.2 sirp when rdm = 01 (one dynamic tdm) .........................................7-89 7.8.5.6.3 sirp when rdm = 10 (two static tdms) ............................................7-90 7.8.5.6.4 sirp when rdm = 11 (two dynamic tdms) .......................................7-90 7.8.6 si idl interface support .......................................................................7-90 7.8.6.1 idl interface example ...........................................................................7-91 7.8.6.2 idl interface programming....................................................................7-95 7.8.7 si gci support......................................................................................7-96 7.8.7.1 si gci activation/deactivation procedure .............................................7-98 7.8.7.2 si gci programming..............................................................................7-98 7.8.7.2.1 normal mode gci programming ...........................................................7-98 7.8.7.2.2 scit programming ................................................................................7-98 7.8.8 serial interface synchronization ..........................................................7-100 7.8.9 nmsi configuration..............................................................................7-100 7.9 baud rate generators (brgs) ............................................................7-103 7.9.1 autobaud support ...............................................................................7-105 7.9.2 brg configuration register (brgc)..................................................7-106 7.9.3 uart baud rate examples ...............................................................7-108 7.10 serial communication controllers (sccs)...........................................7-109 7.10.1 scc overview .....................................................................................7-110 7.10.2 general scc mode register (gsmr) ................................................7-111 7.10.3 scc protocol-specific mode register (psmr) ..................................7-120 7.10.4 scc data synchronization register (dsr)........................................7-121 7.10.5 scc transmit on demand register (todr)......................................7-121 7.10.6 scc buffer descriptors.......................................................................7-122 7.10.7 scc parameter ram..........................................................................7-124 7.10.7.1 bd table pointer (rbase, tbase) ....................................................7-125 7.10.7.2 scc function code registers (rfcr, tfcr)....................................7-125 7.10.7.3 maximum receive buffer length register (mrblr) ..........................7-127 7.10.7.4 receiver bd pointer (rbptr).............................................................7-127 7.10.7.5 transmitter bd pointer (tbptr) .........................................................7-127 7.10.7.6 other general parameters...................................................................7-128 7.10.8 interrupts from the sccs ....................................................................7-128 7.10.8.1 scc event register (scce) ...............................................................7-128 7.10.8.2 scc mask register (sccm) ...............................................................7-129 7.10.8.3 scc status register (sccs) ..............................................................7-129 7.10.9 scc initialization.................................................................................7-129 7.10.10 scc interrupt handling........................................................................7-130 7.10.11 scc timing control .............................................................................7-130 7.10.11.1 synchronous protocols ........................................................................7-130
table of contents paragraph title page number number motorola mc68360 user? manual xiii 7.10.11.2 asynchronous protocols...................................................................... 7-134 7.10.12 digital phase-locked loop (dpll) ..................................................... 7-135 7.10.12.1 data encoding..................................................................................... 7-135 7.10.12.2 dpll operation................................................................................... 7-136 7.10.13 clock glitch detection ......................................................................... 7-139 7.10.14 disabling the sccs on the fly ............................................................ 7-139 7.10.14.1 scc transmitter full sequence.......................................................... 7-140 7.10.14.2 scc transmitter shortcut sequence .............................................. 7-140 7.10.14.3 scc receiver full sequence.............................................................. 7-140 7.10.14.4 scc receiver shortcut sequence ...................................................... 7-141 7.10.14.5 switching protocols ............................................................................. 7-141 7.10.15 saving power ...................................................................................... 7-141 7.10.16 uart controller .................................................................................. 7-141 7.10.16.1 uart key features ............................................................................ 7-143 7.10.16.2 normal asynchronous mode ............................................................... 7-143 7.10.16.3 synchronous mode ............................................................................. 7-144 7.10.16.4 uart memory map............................................................................. 7-145 7.10.16.5 uart programming model ................................................................. 7-147 7.10.16.6 uart command set........................................................................... 7-147 7.10.16.6.1 transmit commands ........................................................................... 7-147 7.10.16.6.2 receive commands ............................................................................ 7-148 7.10.16.7 uart address recognition (receiver)............................................... 7-149 7.10.16.8 uart control characters (receiver).................................................. 7-150 7.10.16.9 wake-up timer (receiver).................................................................. 7-151 7.10.16.10 break support (receiver).................................................................... 7-151 7.10.16.11 send break (transmitter) .................................................................... 7-153 7.10.16.12 sending a preamble (transmitter) ...................................................... 7-153 7.10.16.13 fractional stop bits (transmitter)........................................................ 7-153 7.10.16.14 uart error-handling procedure......................................................... 7-154 7.10.16.14.1 transmission error .............................................................................. 7-155 7.10.16.14.2 reception errors ................................................................................. 7-155 7.10.16.15 uart mode register (psmr) ............................................................ 7-156 7.10.16.16 uart receive buffer descriptor (rx bd)........................................... 7-159 7.10.16.17 uart transmit buffer descriptor (tx bd). ......................................... 7-163 7.10.16.18 uart event register (scce)............................................................. 7-164 7.10.16.19 uart mask register (sccm)............................................................. 7-167 7.10.16.20 scc status register (sccs).............................................................. 7-167 7.10.16.21 scc uart example ........................................................................... 7-167 7.10.16.22 s-records programming example...................................................... 7-169 7.10.17 hdlc controller .................................................................................. 7-169 7.10.17.1 hdlc controller key features............................................................ 7-170 7.10.17.2 hdlc channel frame transmission processing................................ 7-171 7.10.17.3 hdlc channel frame reception processing..................................... 7-172 7.10.17.4 hdlc memory map............................................................................. 7-172 7.10.17.5 hdlc programming model ................................................................. 7-174
table of contents paragraph title page number number xiv mc68360 user? manual motorola 7.10.17.6 hdlc command set ...........................................................................7-175 7.10.17.6.1 transmit commands............................................................................7-175 7.10.17.6.2 receive commands.............................................................................7-176 7.10.17.7 hdlc error-handling procedure..........................................................7-176 7.10.17.7.1 transmission errors.............................................................................7-176 7.10.17.7.2 reception errors ..................................................................................7-177 7.10.17.8 hdlc mode register (psmr) .............................................................7-178 7.10.17.9 hdlc receive buffer descriptor (rx bd) ...........................................7-179 7.10.17.10 hdlc transmit buffer descriptor (tx bd)...........................................7-183 7.10.17.11 hdlc event register (scce) .............................................................7-184 7.10.17.12 hdlc mask register (sccm) .............................................................7-186 7.10.17.13 scc status register (sccs) ..............................................................7-187 7.10.17.14 scc hdlc example #1.......................................................................7-187 7.10.17.15 scc hdlc example #2.......................................................................7-189 7.10.18 hdlc bus controller ...........................................................................7-189 7.10.18.1 hdlc bus key features......................................................................7-192 7.10.18.2 hdlc bus operation ...........................................................................7-192 7.10.18.2.1 accessing the hdlc bus.....................................................................7-192 7.10.18.2.2 more performance ...............................................................................7-193 7.10.18.2.3 delayed rts mode..............................................................................7-194 7.10.18.2.4 using the tsa......................................................................................7-195 7.10.18.3 hdlc bus memory map and programming ........................................7-196 7.10.18.3.1 gsmr programming............................................................................7-196 7.10.18.3.2 psmr programming ............................................................................7-196 7.10.18.3.3 hdlc bus controller example ............................................................7-196 7.10.19 appletalk controller ............................................................................7-196 7.10.19.1 localtalk bus operation......................................................................7-197 7.10.19.2 appletalk controller key features .......................................................7-198 7.10.19.3 quicc appletalk hardware connection.............................................7-198 7.10.19.4 appletalk memory map and programming model...............................7-198 7.10.19.4.1 gsmr programming............................................................................7-199 7.10.19.4.2 psmr programming ............................................................................7-200 7.10.19.4.3 todr programming ............................................................................7-200 7.10.19.4.4 appletalk controller example .............................................................7-200 7.10.20 bisync controller ...............................................................................7-200 7.10.20.1 bisync controller features................................................................7-201 7.10.20.2 bisync channel frame transmission ...............................................7-201 7.10.20.3 bisync channel frame reception.....................................................7-202 7.10.20.4 bisync memory map..........................................................................7-203 7.10.20.5 bisync command set........................................................................7-204 7.10.20.5.1 transmit commands............................................................................7-204 7.10.20.5.2 receive commands.............................................................................7-205 7.10.20.6 bisync control character recognition ..............................................7-206 7.10.20.7 bsync-bisync sync register.........................................................7-207 7.10.20.8 bdle-bisync dle register...............................................................7-208
table of contents paragraph title page number number motorola mc68360 user? manual xv 7.10.20.9 transmitting and receiving the synchronization sequence ............... 7-208 7.10.20.10 bisync error-handling procedure............................................... 7-209 7.10.20.10.1 transmission errors ............................................................................ 7-209 7.10.20.10.2 reception errors ................................................................................. 7-209 7.10.20.11 bisync mode register (psmr)......................................................... 7-209 7.10.20.12 bisync receive buffer descriptor (rx bd) ....................................... 7-211 7.10.20.13 bisync transmit buffer descriptor (tx bd)....................................... 7-213 7.10.20.14 bisync event register (scce) ......................................................... 7-216 7.10.20.15 bisync mask register (sccm) ......................................................... 7-217 7.10.20.16 scc status register (sccs).............................................................. 7-217 7.10.20.17 programming the bisync controller.................................................. 7-217 7.10.20.18 scc bisync example ....................................................................... 7-218 7.10.21 transparent controller ........................................................................ 7-220 7.10.21.1 transparent controller features ......................................................... 7-221 7.10.21.2 transparent channel frame transmission processing ...................... 7-221 7.10.21.3 transparent channel frame reception processing ........................... 7-222 7.10.21.4 achieving synchronization in transparent mode ................................ 7-223 7.10.21.4.1 in-line synchronization pattern .......................................................... 7-223 7.10.21.4.2 transparent synchronization example ............................................... 7-224 7.10.21.5 transparent memory map ................................................................... 7-225 7.10.21.6 transparent command set ................................................................. 7-226 7.10.21.6.1 transmit commands ........................................................................... 7-226 7.10.21.6.2 receive commands ............................................................................ 7-227 7.10.21.7 transparent error-handling procedure ............................................... 7-227 7.10.21.7.1 transmission errors ............................................................................ 7-227 7.10.21.7.2 reception errors ................................................................................. 7-228 7.10.21.8 transparent mode register (psmr)................................................... 7-228 7.10.21.9 transparent receive buffer descriptor (rx bd) ................................. 7-228 7.10.21.10 transparent transmit buffer descriptor (tx bd)................................. 7-230 7.10.21.11 transparent event register (scce) ................................................... 7-232 7.10.21.12 transparent mask register (sccm) ................................................... 7-233 7.10.21.13 scc status register (sccs).............................................................. 7-233 7.10.21.14 scc transparent example ................................................................. 7-233 7.10.22 ram microcodes ................................................................................. 7-235 7.10.23 ethernet controller .............................................................................. 7-235 7.10.23.1 ethernet on quicc?c68en360 .................................................... 7-236 7.10.23.2 ethernet key features ........................................................................ 7-237 7.10.23.3 learning ethernet on the quicc ........................................................ 7-238 7.10.23.4 connecting quicc to ethernet ........................................................... 7-239 7.10.23.5 ethernet channel frame transmission............................................... 7-241 7.10.23.6 ethernet channel frame reception.................................................... 7-242 7.10.23.7 cam interface ..................................................................................... 7-243 7.10.23.8 ethernet memory map......................................................................... 7-246 7.10.23.9 ethernet programming model ............................................................. 7-250 7.10.23.10 ethernet command set....................................................................... 7-250
table of contents paragraph title page number number xvi mc68360 user? manual motorola 7.10.23.10.1 transmit commands............................................................................7-250 7.10.23.10.2 receive commands.............................................................................7-251 7.10.23.10.3 set group address command....................................................7-251 7.10.23.11 ethernet address recognition .............................................................7-252 7.10.23.12 hash table algorithm ..........................................................................7-253 7.10.23.13 interpacket gap time ..........................................................................7-254 7.10.23.14 collision handling ................................................................................7-254 7.10.23.15 internal and external loopback ...........................................................7-255 7.10.23.16 ethernet error-handling procedure ......................................................7-255 7.10.23.16.1 transmission errors.............................................................................7-255 7.10.23.16.2 reception errors ..................................................................................7-256 7.10.23.17 ethernet mode register (psmr) .........................................................7-256 7.10.23.18 ethernet receive buffer descriptor (rx bd)........................................7-258 7.10.23.19 ethernet transmit buffer descriptor (tx bd) .......................................7-261 7.10.23.20 ethernet event register (scce) .........................................................7-264 7.10.23.21 ethernet mask register (sccm) .........................................................7-265 7.10.23.22 ethernet status register (sccs) ........................................................7-265 7.10.23.23 scc ethernet example........................................................................7-266 7.11 serial management controllers (smcs) ..............................................7-268 7.11.1 smc overview .....................................................................................7-268 7.11.2 general smc mode register (smcmr)..............................................7-270 7.11.3 smc buffer descriptors .......................................................................7-270 7.11.4 smc parameter ram ..........................................................................7-270 7.11.4.1 bd table pointer (rbase, tbase) ....................................................7-271 7.11.4.2 smc function code registers (rfcr, tfcr) ...................................7-272 7.11.4.3 maximum receive buffer length register (mrblr) ..........................7-273 7.11.4.4 receiver buffer descriptor pointer (rbptr).......................................7-273 7.11.4.5 transmitter buffer descriptor pointer (tbptr) ...................................7-274 7.11.4.6 other general parameters...................................................................7-274 7.11.5 disabling the smcs on the fly.............................................................7-274 7.11.5.1 smc transmitter full sequence..........................................................7-275 7.11.5.2 smc transmitter shortcut sequence ..................................................7-275 7.11.5.3 smc receiver full sequence..............................................................7-275 7.11.5.4 smc receiver shortcut sequence ......................................................7-276 7.11.5.5 switching protocols..............................................................................7-276 7.11.6 saving power.......................................................................................7-276 7.11.7 smc as a uart ..................................................................................7-276 7.11.7.1 smc uart key features....................................................................7-276 7.11.7.2 smc uart comparison......................................................................7-276 7.11.7.3 smc uart memory map ....................................................................7-277 7.11.7.4 smc uart transmission processing .................................................7-278 7.11.7.5 smc uart reception processing ......................................................7-279 7.11.7.6 smc uart programming model.........................................................7-279 7.11.7.7 smc uart command set ..................................................................7-279 7.11.7.7.1 transmit commands............................................................................7-279
table of contents paragraph title page number number motorola mc68360 user? manual xvii 7.11.7.7.2 receive commands ............................................................................ 7-280 7.11.7.8 send break (transmitter) .................................................................... 7-280 7.11.7.9 sending a preamble (transmitter) ...................................................... 7-280 7.11.7.10 smc uart error-handling procedure................................................ 7-281 7.11.7.10.1 overrun error ...................................................................................... 7-281 7.11.7.10.2 parity error .......................................................................................... 7-281 7.11.7.10.3 idle sequence receive ....................................................................... 7-281 7.11.7.10.4 framing error ...................................................................................... 7-281 7.11.7.10.5 break sequence.................................................................................. 7-281 7.11.7.11 smc uart mode register (smcmr) ................................................ 7-281 7.11.7.12 smc uart receive buffer descriptor (rx bd).................................. 7-283 7.11.7.13 smc uart transmit buffer descriptor (tx bd) ................................. 7-286 7.11.7.14 smc uart event register (smce) ................................................... 7-288 7.11.7.15 smc uart mask register (smcm) ................................................... 7-290 7.11.8 smc uart example........................................................................... 7-290 7.11.9 smc interrupt handling....................................................................... 7-291 7.11.10 smc as a transparent controller........................................................ 7-291 7.11.10.1 smc transparent controller key features ........................................ 7-291 7.11.10.2 smc transparent comparison............................................................ 7-292 7.11.10.3 smc transparent memory map .......................................................... 7-292 7.11.10.4 smc transparent transmission processing....................................... 7-292 7.11.10.5 smc transparent reception processing ............................................ 7-293 7.11.10.6 using the smsynx pin for synchronization........................................ 7-293 7.11.10.7 using the tsa for synchronization ..................................................... 7-295 7.11.10.8 smc transparent command set ........................................................ 7-297 7.11.10.8.1 transmit commands ........................................................................... 7-297 7.11.10.8.2 receive commands ............................................................................ 7-297 7.11.10.9 smc transparent error-handling procedure ...................................... 7-298 7.11.10.9.1 transmission error (underrun)............................................................ 7-298 7.11.10.9.2 reception error (overrun)................................................................... 7-298 7.11.10.10 smc transparent mode register (smcmr)....................................... 7-298 7.11.10.11 smc transparent receive buffer descriptor (rx bd) ........................ 7-299 7.11.10.12 smc transparent transmit buffer descriptor (tx bd)........................ 7-300 7.11.10.13 smc transparent event register (smce).......................................... 7-302 7.11.10.14 smc transparent mask register (smcm).......................................... 7-303 7.11.11 smc transparent nmsi example ....................................................... 7-303 7.11.12 smc transparent tsa example ......................................................... 7-304 7.11.13 smc interrupt handling....................................................................... 7-305 7.11.14 smc as a gci controller..................................................................... 7-305 7.11.14.1 smc gci memory map ....................................................................... 7-306 7.11.14.1.1 smc monitor channel transmission................................................... 7-306 7.11.14.1.2 smc monitor channel reception........................................................ 7-307 7.11.14.2 smc c/i channel handling ................................................................. 7-307 7.11.14.2.1 smc c/i channel transmission .......................................................... 7-307 7.11.14.2.2 smc c/i channel reception ............................................................... 7-307
table of contents paragraph title page number number xviii mc68360 user? manual motorola 7.11.14.3 smc commands in gci mode ............................................................7-307 7.11.14.4 smc gci mode register (smcmr) ....................................................7-308 7.11.14.5 smc monitor channel rx bd ..............................................................7-309 7.11.14.6 smc monitor channel tx bd...............................................................7-310 7.11.14.7 smc c/i channel receive buffer descriptor (rx bd) .........................7-310 7.11.14.8 smc c/i channel transmit buffer descriptor (tx bd).........................7-311 7.11.14.9 smc event register (smce)...............................................................7-311 7.11.14.10 smc mask register (smcm)...............................................................7-312 7.12 serial peripheral interface (spi) ..........................................................7-312 7.12.1 overview ..............................................................................................7-312 7.12.2 spi key features.................................................................................7-313 7.12.3 spi clocking and pin functions...........................................................7-314 7.12.4 spi transmit/receive process ............................................................7-315 7.12.4.1 spi master mode .................................................................................7-315 7.12.4.2 spi slave mode ...................................................................................7-316 7.12.4.3 spi multi-master operation..................................................................7-316 7.12.5 spi programming model......................................................................7-317 7.12.5.1 spi mode register (spmode)............................................................7-317 7.12.5.2 spi command register (spcom).......................................................7-319 7.12.5.3 spi parameter ram memory map ......................................................7-320 7.12.5.3.1 bd table pointer (rbase, tbase) ....................................................7-320 7.12.5.3.2 spi function code registers (rfcr, tfcr)......................................7-321 7.12.5.3.3 maximum receive buffer length register (mrblr) ..........................7-322 7.12.5.3.4 receiver buffer descriptor pointer (rbptr).......................................7-322 7.12.5.3.5 transmitter buffer descriptor pointer (tbptr) ...................................7-323 7.12.5.3.6 other general parameters...................................................................7-323 7.12.5.4 spi commands....................................................................................7-323 7.12.5.4.1 init tx parameters command .....................................................7-323 7.12.5.4.2 close rx bd command....................................................................7-323 7.12.5.4.3 init rx parameters command.....................................................7-323 7.12.5.5 spi buffer descriptor ring...................................................................7-324 7.12.5.5.1 spi receive buffer descriptor (rx bd) ...............................................7-324 7.12.5.5.2 spi transmit buffer descriptor (tx bd)...............................................7-326 7.12.5.6 spi event register (spie) ...................................................................7-328 7.12.5.7 spi mask register (spim) ...................................................................7-329 7.12.6 spi master example ............................................................................7-329 7.12.7 spi slave example ..............................................................................7-330 7.12.8 spi interrupt handling..........................................................................7-331 7.13 parallel interface port (pip) .................................................................7-331 7.13.1 pip key features.................................................................................7-331 7.13.2 pip overview .......................................................................................7-332 7.13.3 general-purpose i/o pins (port b) ......................................................7-333 7.13.4 interlocked data transfers...................................................................7-333 7.13.5 pulsed data transfers .........................................................................7-334 7.13.5.1 busy signal ..........................................................................................7-335
table of contents paragraph title page number number motorola mc68360 user? manual xix 7.13.5.2 pulsed handshake timing .................................................................. 7-336 7.13.6 transparent data transfers ................................................................ 7-338 7.13.7 programming model ............................................................................ 7-338 7.13.7.1 parameter ram................................................................................... 7-338 7.13.7.2 pip configuration register (pipc) ...................................................... 7-339 7.13.7.3 pip timing parameters register (ptpr)............................................ 7-341 7.13.7.4 pip buffer descriptors......................................................................... 7-341 7.13.7.5 pip event register (pipe) .................................................................. 7-341 7.13.7.6 pip mask register (pipm) .................................................................. 7-342 7.13.8 centronics controller overview........................................................... 7-342 7.13.8.1 centronics controller key features .................................................... 7-344 7.13.8.2 centronics channel transmission ...................................................... 7-345 7.13.8.3 centronics transmitter memory map .................................................. 7-345 7.13.8.4 buffer descriptor table pointer (tbase)............................................ 7-346 7.13.8.5 status mask register (smask) .......................................................... 7-346 7.13.8.6 centronics function code register (cfcr) ....................................... 7-346 7.13.8.7 transmitter buffer descriptor pointer (tbptr)................................... 7-347 7.13.8.8 centronics transmitter programming model....................................... 7-347 7.13.8.9 centronics transmitter command set ................................................ 7-347 7.13.8.9.1 stop transmit command.............................................................. 7-347 7.13.8.9.2 restart transmit command....................................................... 7-347 7.13.8.9.3 init tx parameters c ommand..................................................... 7-348 7.13.8.10 transmission errors ............................................................................ 7-348 7.13.8.10.1 buffer descriptor not ready ............................................................... 7-348 7.13.8.10.2 printer off-line error ........................................................................... 7-348 7.13.8.10.3 printer fault......................................................................................... 7-348 7.13.8.10.4 paper error.......................................................................................... 7-348 7.13.8.10.5 centronics transmitter buffer descriptor ............................................ 7-348 7.13.8.11 centronics transmitter event register (pipe).................................... 7-349 7.13.8.12 centronics channel reception............................................................ 7-350 7.13.8.13 centronics receiver memory map ...................................................... 7-350 7.13.8.14 buffer descriptor table pointer (rbase) ........................................... 7-351 7.13.8.15 centronics function code register (cfcr) ....................................... 7-351 7.13.8.16 receiver buffer descriptor pointer (rbptr) ...................................... 7-352 7.13.8.17 centronics receiver programming model........................................... 7-352 7.13.8.18 centronics control characters ............................................................ 7-352 7.13.8.19 centronics silence period ................................................................... 7-354 7.13.8.20 centronics receiver command set .................................................... 7-354 7.13.8.20.1 init rx parameters command .................................................... 7-354 7.13.8.20.2 close rx bd command................................................................... 7-354 7.13.8.21 receiver errors ................................................................................... 7-354 7.13.8.21.1 buffer descriptor busy ........................................................................ 7-354 7.13.8.22 centronics receive buffer descriptor ................................................. 7-354 7.13.8.23 centronics receiver event register (pipe)........................................ 7-355 7.13.9 port b registers .................................................................................. 7-356
table of contents paragraph title page number number xx mc68360 user? manual motorola 7.13.9.1 port b assignment registers (pbpar) ...............................................7-356 7.13.9.2 data direction register (pbdir) .........................................................7-356 7.13.9.3 data register (pbdat)........................................................................7-356 7.13.9.4 open-drain register (pbodr)............................................................7-356 7.14 parallel i/o ports..................................................................................7-356 7.14.1 parallel i/o key features.....................................................................7-357 7.14.2 parallel i/o overview ...........................................................................7-357 7.14.3 port a pin functions ............................................................................7-357 7.14.4 port a registers...................................................................................7-359 7.14.4.1 port a open-drain register (paodr).................................................7-359 7.14.4.2 port a data register (padat).............................................................7-359 7.14.4.3 port a data direction register (padir) ..............................................7-359 7.14.4.4 port a pin assignment register (papar) ...........................................7-359 7.14.5 port a examples ..................................................................................7-360 7.14.6 port b pin functions ............................................................................7-362 7.14.7 port b registers...................................................................................7-363 7.14.7.1 port b open-drain register (pbodr).................................................7-363 7.14.7.2 port b data register (pbdat).............................................................7-364 7.14.7.3 port b data direction register (pbdir) ..............................................7-364 7.14.7.4 port b pin assignment register (pbpar) ...........................................7-364 7.14.8 port b example ....................................................................................7-365 7.14.9 port c pin functions ............................................................................7-365 7.14.10 port c registers...................................................................................7-367 7.14.10.1 port c data register (pcdat) ............................................................7-368 7.14.10.2 port c data direction register (pcdir) ..............................................7-368 7.14.10.3 port c pin assignment register (pcpar)...........................................7-368 7.14.10.4 port c special options (pcso) ...........................................................7-368 7.14.10.5 port c interrupt control register (pcint) ...........................................7-369 7.15 cpm interrupt controller (cpic) ..........................................................7-369 7.15.1 overview ..............................................................................................7-370 7.15.2 cpm interrupt source priorities ...........................................................7-372 7.15.2.1 scc relative priority ...........................................................................7-372 7.15.2.2 highest priority interrupt ......................................................................7-372 7.15.2.3 nested interrupts .................................................................................7-373 7.15.3 masking interrupt sources in the cpm ................................................7-374 7.15.4 interrupt vector generation and calculation........................................7-375 7.15.5 cpic programming model ...................................................................7-377 7.15.5.1 cpm interrupt configuration register (cicr)......................................7-377 7.15.5.2 cpm interupt pending register (cipr) ...............................................7-379 7.15.5.3 cpm interrupt mask register (cimr) ..................................................7-380 7.15.5.4 cpm interrupt in-service register (cisr) ...........................................7-380 7.15.6 interrupt handler examples .................................................................7-381 7.15.6.1 example 1?c6 interrupt handler .....................................................7-381 7.15.6.2 example 2?cc1 interrupt handler...................................................7-381
table of contents paragraph title page number number motorola mc68360 user? manual xxi section 8 scan chain test access port 8.1 overview ................................................................................................. 8-1 8.2 tap controller......................................................................................... 8-2 8.3 boundary scan register ......................................................................... 8-3 8.4 instruction register ............................................................................... 8-10 8.4.1 extest ................................................................................................ 8-10 8.4.2 sample/preload.............................................................................. 8-10 8.4.3 bypass ................................................................................................ 8-11 8.4.4 clamp .................................................................................................. 8-11 8.4.5 hi-z ....................................................................................................... 8-11 8.5 quicc restrictions ............................................................................... 8-11 8.6 non-scan chain operation ................................................................... 8-12 section 9 applications 9.1 minimum system configuration .............................................................. 9-1 9.1.1 quicc hardware configuration.............................................................. 9-1 9.1.1.1 quicc basic accesses........................................................................... 9-1 9.1.1.2 clocking strategy. ................................................................................... 9-3 9.1.1.3 resetting the quicc............................................................................... 9-3 9.1.1.4 interrupts. ................................................................................................ 9-3 9.1.1.5 bus arbitration......................................................................................... 9-3 9.1.1.6 breakpoint generation. ........................................................................... 9-3 9.1.1.7 bus monitor function. ............................................................................. 9-3 9.1.1.8 spurious interrupt monitor....................................................................... 9-3 9.1.1.9 software watchdog. ................................................................................ 9-3 9.1.1.10 double bus fault..................................................................................... 9-4 9.1.1.11 jtag and three-state. ........................................................................... 9-4 9.1.1.12 quicc serial ports. ................................................................................ 9-4 9.1.2 memory interfaces................................................................................... 9-4 9.1.2.1 quicc memory interface pins................................................................ 9-4 9.1.2.2 regular eprom...................................................................................... 9-5 9.1.2.3 flash eprom. ........................................................................................ 9-5 9.1.2.4 sram ...................................................................................................... 9-6 9.1.2.5 eeprom................................................................................................. 9-7 9.1.2.6 dram simm. .......................................................................................... 9-8 9.1.2.7 dram devices. ....................................................................................... 9-9 9.1.3 software configuration.......................................................................... 9-10 9.1.3.1 basic initialization.................................................................................. 9-10 9.1.3.2 configuring the memory controller. ...................................................... 9-11 9.1.3.3 using the quicc in 16-bit data bus mode........................................... 9-12 9.2 how to take a quicc software test-drive........................................... 9-13 step 1: decide on reset stack pointer and initial program counter .... 9-13 step 2: stay in supervisor mode........................................................... 9-13 step 3: write the vbr ........................................................................... 9-14
table of contents paragraph title page number number xxii mc68360 user? manual motorola step 4: write the mbar.........................................................................9-14 step 5: verify a dual-port ram location...............................................9-14 step 6: is this a power-up reset?........................................................9-14 step 7: deal with the clock synthesizer ................................................9-14 step 8: initialize system protection .......................................................9-15 step 9: clear entire dual-port ram ......................................................9-15 step 10: write the pepar .....................................................................9-15 step 11: remap chip select 0...............................................................9-15 step 12: initialize the system ram........................................................9-15 step 13: copy the evt to system ram ................................................9-16 step 14: initialize all other memory and peripherals ............................9-16 step 15: initialize the rest of the sim60................................................9-16 step 16: generate a sim60 interrupt.....................................................9-16 step 17: test the cpm...........................................................................9-17 step 18: generate interrupts with the cpm ...........................................9-17 step 19: enable external interrupts .......................................................9-17 step 20: enable external bus masters ..................................................9-18 step 21: off to the races.......................................................................9-18 9.3 porting mc68302 imp code to the mc68360 quicc...........................9-18 9.3.1 cpu and compilers ...............................................................................9-18 9.3.2 differences/similarities ..........................................................................9-18 9.3.3 notes about porting...............................................................................9-19 9.3.4 how to port mc68302 functions..........................................................9-19 9.3.4.1 system configuration registers. ...........................................................9-19 9.3.4.1.1 base address register (bar). ..............................................................9-19 9.3.4.1.2 system control register (scr). ............................................................9-20 9.3.4.2 system ram. .........................................................................................9-21 9.3.4.2.1 buffer descriptors. .................................................................................9-21 9.3.4.2.2 protocol-independent parameter ram values......................................9-21 9.3.4.2.3 protocol-dependent parameter ram values. .......................................9-22 9.3.4.3 internal registers (system integration block)........................................9-23 9.3.4.4 internal registers (communication processor). ....................................9-26 9.4 using the quicc mc68040 companion mode .....................................9-31 9.4.1 mc68ec040 to quicc interface...........................................................9-32 9.4.1.1 mc68ec040 reads and writes to quicc............................................9-32 9.4.1.2 clocking strategy...................................................................................9-34 9.4.1.3 reset strategy. ......................................................................................9-34 9.4.1.4 interrupts................................................................................................9-34 9.4.2 memory interfaces .................................................................................9-37 9.4.2.1 quicc memory interface pins. .............................................................9-37 9.4.2.2 regular eprom. ...................................................................................9-38 9.4.2.3 burst eprom. .......................................................................................9-38 9.4.2.4 flash eprom. .......................................................................................9-41 9.4.2.5 regular sram. ......................................................................................9-41 9.4.2.6 burst sram. ..........................................................................................9-41
table of contents paragraph title page number number motorola mc68360 user? manual xxiii 9.4.2.7 eeprom............................................................................................... 9-45 9.4.2.8 dram simm ......................................................................................... 9-45 9.4.2.9 dram devices. ..................................................................................... 9-46 9.4.3 software configuration.......................................................................... 9-48 9.4.3.1 basic initialization.................................................................................. 9-49 9.4.3.2 configuring the memory controller. ...................................................... 9-49 9.4.4 interfacing multiple quiccs to an mc68ec040 ................................... 9-51 9.5 selecting cache modes on the mc68ec040........................................ 9-51 9.5.1 the algorithm ........................................................................................ 9-52 9.5.2 protection .............................................................................................. 9-52 9.5.3 mc68ec040 cache behavior ............................................................... 9-53 9.5.4 enabling the caching modes ................................................................ 9-53 9.6 interfacing the quicc to the 53c90 scsi controller .............................. 9-54 9.6.1 scsi general overview ........................................................................ 9-54 9.6.2 physical interface .................................................................................. 9-54 9.6.3 logical interface .................................................................................... 9-59 9.6.4 functional description........................................................................... 9-61 9.6.5 hardware configuration ........................................................................ 9-62 9.6.5.1 clocking strategy. ................................................................................. 9-62 9.6.5.2 reset strategy....................................................................................... 9-62 9.6.5.3 read/write timing.................................................................................. 9-62 9.6.5.4 interrupt handling.................................................................................. 9-62 9.6.5.5 idma1 setup and timing. ..................................................................... 9-64 9.6.5.6 quicc i/o ports.................................................................................... 9-65 9.6.6 active scsi terminations ..................................................................... 9-65 9.6.7 software configuration.......................................................................... 9-65 9.6.7.1 configuring idma1. ............................................................................... 9-65 9.6.7.2 configuring the memory controller. ..................................................... 9-66 9.7 using the quicc as a tap controller for board self-test ................... 9-66 9.7.1 board layout ......................................................................................... 9-67 9.7.2 board testing ........................................................................................ 9-68 9.7.3 microcontroller interface........................................................................ 9-70 9.7.4 test pattern generation ........................................................................ 9-72 9.8 interfacing an mc68ec030 master to the quicc in slave mode ........ 9-74 9.8.1 mc68ec030 to quicc interface .......................................................... 9-74 9.8.1.1 mc68ec030 reads and writes to quicc............................................ 9-75 9.8.1.2 clocking strategy. ................................................................................. 9-75 9.8.1.3 reset strategy....................................................................................... 9-77 9.8.1.4 interrupts ............................................................................................... 9-77 9.8.1.5 bus arbitration....................................................................................... 9-78 9.8.1.6 breakpoint generation .......................................................................... 9-78 9.8.1.7 bus monitor function ............................................................................ 9-78 9.8.1.8 spurious interrupt monitor..................................................................... 9-78 9.8.1.9 software watchdog ............................................................................... 9-79 9.8.1.10 periodic interval timer .......................................................................... 9-79
table of contents paragraph title page number number xxiv mc68360 user? manual motorola 9.8.1.11 mc68ec030 caching configuration......................................................9-79 9.8.1.12 double bus fault ...................................................................................9-79 9.8.1.13 jtag and three-state...........................................................................9-79 9.8.1.14 quicc serial ports................................................................................9-79 9.8.2 memory interfaces .................................................................................9-79 9.8.2.1 quicc memory interface pins ..............................................................9-80 9.8.2.2 regular eprom or flash eprom ........................................................9-80 9.8.2.3 regular sram .......................................................................................9-82 9.8.2.4 eeprom ...............................................................................................9-84 9.8.2.5 dram simm ..........................................................................................9-84 9.8.2.6 dram devices.......................................................................................9-86 9.8.3 software configuration ..........................................................................9-86 9.8.3.1 basic initialization ..................................................................................9-86 9.8.3.2 configuring the memory controller ........................................................9-87 9.8.4 interfacing multiple quiccs to an mc68ec030....................................9-89 9.8.5 using a higher speed mc68ec030 master with the quicc ................9-89 9.9 putting a background debug mode connector on a target board .......9-90 section 10 electrical characteristics 10.1 maximum ratings ..................................................................................10-1 10.2 thermal characteristics .........................................................................10-2 10.3 power considerations............................................................................10-2 10.4 ac electrical specification definitions ...................................................10-3 10.5 dc electrical specifications ...................................................................10-5 10.6 ac power dissipation ............................................................................10-6 10.7 ac electrical specifications control timing...........................................10-7 10.8 external capacitor for pll.....................................................................10-8 10.9 bus operation ac timing specifications ...............................................10-9 10.9 bus operation ac timing specifications (continued) .........................10-10 10.9 bus operation ac timing specifications (continued) ........................10-11 10.9 bus operation ac timing specifications (continued ..........................10-12 10.10 bus operation?ram accesses ac timing specifications .............10-28 10.11 030/quicc bus type slave mode bus arbitration ac electrical specifica- tions 10-33 10.12 030/quicc bus type slave mode internal read/write/iack asynchronous cycles ac electrical specifications..............................10-36 10.14 030/quicc bus type sram/dram cycles ac electrical specifications10- 44 10.15 040 bus type slave mode bus arbitration ac electrical specifications10-49 10.16 040 bus type slave mode internal read/write/iack cycles ac electrical specifications10-51 10.17 040 bus type sram/dram cycles ac electrical specifications .......10-56 10.18 idma ac electrical specifications ......................................................10-62 10.19 pip/pio ac electrical specifications ...................................................10-64
table of contents paragraph title page number number motorola mc68360 user? manual xxv 10.20 interrupt controller ac electrical specifications.................................. 10-66 10.21 baud rate generator ac electrical specifications ............................. 10-67 10.22 timer electrical specifications ............................................................ 10-68 10.23 si electrical specifications .................................................................. 10-69 10.24 scc in nmsi mode?xternal clock electrical specifications .......... 10-75 10.25 scc in nmsi mode?nternal clock electrical specifications.......... 10-75 10.26 ethernet electrical specifications ....................................................... 10-77 10.27 smc transparent mode electrical specifications .............................. 10-80 10.28 spi master electrical specifications................................................... 10-82 10.29 spi slave electrical specifications..................................................... 10-83 10.30 jtag electrical specifications ............................................................ 10-85 section 11 ordering information and mechanical data 11.1 standard ordering information.............................................................. 11-1 11.2 pin assignment?40-lead quad flat pack (qfp) .............................. 11-2 11.3 pin assignment?41-lead pin grid array (pga) ................................ 11-4 11.4 pin assignment?57-lead ball grid array (bga) ............................ 11-5 11.5 package dimensions?qfp (fe suffix) ............................................. 11-6 11.6 package dimensions?ga (rc suffix)............................................... 11-7 11.7 package dimensions?ga (zp suffix) ............................................... 11-8 appendix a serial performance appendix b development tools and support b.1 motorola software modules.................................................................... b-1 b.2 other protocol software support............................................................ b-5 b.3 third-party software support................................................................. b-6 b.4 m68360quads development system ................................................... b-6 b.5 other development boards.................................................................. b-10 b.6 direct target development .................................................................. b-10 appendix c risc microcode from ram c.1 signaling system #7 controller ..............................................................c-1 c.1.1 performance............................................................................................c-2 c.2 multiple gci controller ............................................................................c-3 c.2.1 typical application ..................................................................................c-3 c.2.2 mgci controller key features ................................................................c-3 c.2.3 performance............................................................................................c-4 c.3 atom1/atm controller...........................................................................c-4 c.3.1 key features ...........................................................................................c-4 c.3.2 performance............................................................................................c-5
table of contents paragraph title page number number xxvi mc68360 user? manual motorola c.4 asynchronous hdlc for ppp ................................................................. c-6 c.4.1 key features........................................................................................... c-6 c.4.2 performance ........................................................................................... c-7 c.5 profibus controller ............................................................................. c-7 c.5.1 key features........................................................................................... c-7 c.6 enhanced ethernet filtering ................................................................... c-8 c.6.1 key features........................................................................................... c-8 c.6.2 performance ........................................................................................... c-8 appendix d mc68mh360 product brief d.1 quicc32 key features .......................................................................... d-1 d.1.1 general ................................................................................................... d-1 d.1.2 serial interface........................................................................................ d-2 d.1.3 system interface ..................................................................................... d-2 d.2 quicc architecture overview ................................................................ d-2 d.2.1 cpu32+ core.......................................................................................... d-3 d.2.2 system integration module (sim60) ....................................................... d-4 d.2.3 communications processor module (cpm)............................................ d-4 4.2.3.1 quicc32 serial configurations .............................................................. d-5 d.2.4 the qmc microcode............................................................................... d-7 d.2.5 data flow................................................................................................ d-8 d.2.6 data management .................................................................................. d-8 d.2.7 performance ........................................................................................... d-9 d.2.8 development support ........................................................................... d-10 d.2.9 ordering information ............................................................................. d-10
motorola mc68360 user? manual 1-1 section 1 introduction the mc68360 quad integrated communication controller (quicc ? ) is a versatile one- chip integrated microprocessor and peripheral combination that can be used in a variety of controller applications. it particularly excels in communications activities. the quicc (pro- nounced ?uick? can be described as a next-generation mc68302 with higher performance in all areas of device operation, increased flexibility, major extensions in capability, and higher integration. the term "quad" comes from the fact that there are four serial communi- cations controllers (sccs) on the device; however, there are actually seven serial channels: four sccs, two serial management controllers (smcs), and one serial peripheral interface (spi). the purpose of this document is to describe the operation of all quicc functionality. although this document has an overview of the cpu32+, the m68000pm/ad m68000 fam- ily programmer's reference manual should be used in addition to this document. the cpu32rm/ad, m68300 family cpu32 reference manual, also provides information on the cpu32. 1.1 quicc key features the following list summarizes the key mc68360 quicc features: cpu32+ processor (4.5 mips at 25 mhz) ?2-bit version of the cpu32 core (fully compatible with the cpu32) ?ackground debug mode ?yte-misaligned addressing up to 32-bit data bus (dynamic bus sizing for 8 and 16 bits) up to 32 address lines (at least 28 always available) complete static design (0?5-mhz operation) slave mode to disable cpu32+ (allows use with external processors) ?ultiple quiccs can share one system bus (one master) ?c68040 companion mode allows quicc to be an mc68040 companion chip and intelligent peripheral (22 mips at 25 mhz) ?lso supports external mc68030-type bus masters ?ll quicc features usable in slave mode memory controller (eight banks) ?ontains complete dynamic random-access memory (dram) controller ?ach bank can be a chip select or support a dram bank ?p to 15 wait states thi d t t d ith f m k 4 0 4
introduction 1-2 mc68360 user? manual motorola ?lueless interface to dram single in-line memory modules (simms), static ran- dom-access memory (sram), electrically programmable read-only memory (eprom), flash eprom, etc. ?our cas lines, four we lines, one oe line ?oot chip select available at reset (options for 8-, 16-, or 32-bit memory) ?pecial features for mc68040 including burst mode support four general-purpose timers ?uperset of mc68302 timers ?our 16-bit timers or two 32-bit timers ?ate mode can enable/disable counting two independent dmas (idmas) ?ingle address mode for fastest transfers ?uffer chaining and auto buffer modes ?utomatically performs efficient packing ?2-bit internal and external transfers system integration module (sim60) ?us monitor ?ouble bus fault monitor ?purious interrupt monitor ?oftware watchdog ?eriodic interrupt timer ?ow power stop mode ?lock synthesizer ?reakpoint logic provides on-chip hardware breakpoints ?xternal masters may use on-chip features such as chip selects ?n-chip bus arbitration with no overhead for internal masters ?jtag test access port interrupts ?even external irq lines ?2 port pins with interrupt capability ?6 internal interrupt sources ?rogrammable priority between sccs ?rogrammable highest priority request communications processor module (cpm) ?isc controller ?any new commands (e.g., graceful stop transmit, close rxbd) ?24 buffer descriptors ?upports continuous mode transmission and reception on all serial channels ?.5 kbytes of dual-port ram ?4 serial dma (sdma) channels ?hree parallel i/o registers with open-drain capability ?ach serial channel can have its own pins (nmsi mode) four baud rate generators
introduction motorola mc68360 user? manual 1-3 ?ndependent (can be connected to any scc or smc) ?llows changes during operation ?utobaud support option four sccs ?thernet/ieee 802.3 optional on scc1 (full 10-mbps support) ?dlc/sdlc 1 (all four channels supported at 2 mbps) ?dlc bus (implements an hdlc-based local area network (lan)) ?ppletalk 2 ?ignaling system #7 ?niversal asynchronous receiver transmitter (uart) ?ynchronous uart ?inary synchronous communication (bisync) ?otally transparent (bit streams) ?otally transparent (frame based with optional cyclic redundancy check (crc)) ?rofibus (ram microcode option) ?synchronous hdlc (ram microcode option) ?cmp 3 (ram microcode option) ?.14 (ram microcode option) ?.21 (ram microcode option) two smcs ?art ?ransparent ?eneral circuit interface (gci) controller ?an be connected to the time-division multiplexed (tdm) channels one spi ?uperset of the mc68302 scp ?upports master and slave modes ?upports multimaster operation on the same bus time-slot assigner supports two tdm channels ?ach tdm channel can be t1, cept, pcm highway, isdn basic rate, isdn primary rate, user defined ?- or 8-bit resolution ?llows independent transmit and receive routing, frame syncs, clocking ?llows dynamic changes ?an be internally connected to six serial channels (four sccs and two smcs) 1. sdlc is a trademark of international business machines. 2. appletalk is a registered trademark of apple computer, inc. 3. ddcmp is a trademark of digital equipment corporation.
introduction 1-4 mc68360 user? manual motorola parallel interface port ?entronics 4 interface support ?upports fast connection between quiccs 240 pins defined: 241-lead pin grid array (pga) and 240-lead plastic quad flat pack (pqfp) 1.2 quicc architecture overview the quicc is 32-bit controller that is an extension of other members of the motorola m68300 family. like other members of the m68300 family, the quicc incorporates the inter- module bus (imb). (the mc68302 is an exception, having an m68000 bus on chip.) the imb provides a common interface for all modules of the m68300 family, which allows motorola to develop new devices more quickly by using the library of existing modules. although the imb definition always included an option for an on-chip 32-bit bus, the quicc is the first device to implement this option. the quicc is comprised of three modules: the cpu32+ core, the sim60, and the cpm. each module utilizes the 32-bit imb. the mc68360 quicc block diagram is shown in figure 1-1. figure 1-1. quicc block diagram 4. centronics is a trademark of centronics, inc. external bus interface system protection sim 60 cpu32+ core imb (32 bit) risc controller system i/f 2.5-kbyte dual-port ram dram controller and chip selects cpm periodic timer clock generation other features breakpoint logic jtag communications processor four general- purpose timers interrupt controller other features timer slot assigner seven serial channels two idmas fourteen serial dmas
introduction motorola mc68360 user? manual 1-5 1.2.1 cpu32+ core the cpu32+ core is a cpu32 that has been modified to connect directly to the 32-bit imb and apply the larger bus width. although the original cpu32 core had a 32-bit internal data path and 32-bit arithmetic hardware, its interface to the imb was 16 bits. the cpu32+ core can operate on 32-bit external operands with one bus cycle. this allows the cpu32+ core to fetch a long-word instruction in one bus cycle and to fetch two word-length instructions in one bus cycle, filling the internal instruction queue more quickly. the cpu32+ core can also read and write 32-bits of data in one bus cycle. although the cpu32+ instruction timings are improved, its instruction set is identical to that of the cpu32. it will also execute the entire m68000 instruction set. it contains the same background debug mode (bdm) features as the cpu32. no new compilers, assemblers, or other software support tools need be implemented for the cpu32+; standard cpu32 tools can be used. the cpu32+ delivers approximately 4.5 mips at 25 mhz, based on the standard (accepted) assumption that a 10-mhz m68000 delivers 1 vax mips. if an application requires more performance, the cpu32+ can be disabled, allowing the rest of the quicc to operate as an intelligent peripheral to a faster processor. the quicc provides a special mode called mc68040 companion mode to allow it to conveniently interface to members of the m68040 family. this two-chip solution provides a 22-mips performance at 25 mhz. the cpu32+ also offers automatic byte alignment features that are not offered on the cpu32. these features allow 16 or 32-bit data to be read or written at an odd address. the cpu32+ automatically performs the number of bus cycles required. 1.2.2 system integration module (sim60) the sim60 integrates general-purpose features that would be useful in almost any 32-bit processor system. the term ?im60?is derived from the quicc part number, mc68360. the sim60 is an enhanced version of the sim40 that exists on the mc68340 and mc68330 devices. first, new features, such as a dram controller and breakpoint logic, have been added. sec- ond, the sim40 was modified to support a 32-bit imb as well as a 32-bit external system bus. third, new configurations, such as slave mode and internal accesses by an external master, are supported. although the quicc is always a 32-bit device internally, it may be configured to operate with a 16-bit data bus. regardless of the choice of the system bus size, dynamic bus sizing is supported. bus sizing allows 8-, 16-, and 32-bit peripherals and memory to exist in the 32- bit system bus mode and 8- and 16-bit peripherals and memory to exist in the 16-bit system bus mode.
introduction 1-6 mc68360 user? manual motorola 1.2.3 communications processor module (cpm) the cpm contains features that allow the quicc to excel in communications and control applications. these features may be divided into three sub-groups: communications processor (cp) two idma controllers four general-purpose timers the cp provides the communication features of the quicc. included are a risc processor, four sccs, two smcs, one spi, 2.5 kbytes of dual-port ram, an interrupt controller, a time slot assigner, three parallel ports, a parallel interface port, four independent baud rate gen- erators, and fourteen serial dma channels to support the sccs, smcs, and spi. the idmas provide two channels of general-purpose dma capability. they offer high- speed transfers, 32-bit data movement, buffer chaining, and independent request and acknowledge logic. the risc controller may access the idma registers directly in the buffer chaining modes. the quicc idmas are similar to, yet enhancements of, the two dma chan- nels found on the mc68340 and the one idma channel found on the mc68302. the four general-purpose timers on the quicc are functionally similar to the two general- purpose timers found on the mc68302. however, they offer some minor enhancements, such as the internal cascading of two timers to form a 32-bit timer. the quicc also contains a periodic interval timer in the sim60, bringing the total to five on-chip timers. 1.3 upgrading designs from the mc68302 since the quicc is a next-generation mc68302, many designers currently using the mc68302 may wish to use the quicc in a follow-on design. the following paragraphs briefly discuss this endeavor in terms of architectural approach, hardware issues, and soft- ware issues. see section 9 applications for further information. 1.3.1 architectural approach the quicc is the logical extension of the mc68302, but the overall architecture and philos- ophy of the mc68302 design remains intact in the quicc. the quicc keeps the best fea- tures of the mc68302, while making the changes required to provide for the increased flexibility, integration, and performance requested by customers. because the cpm is prob- ably the most difficult module to learn, anyone who has used the mc68302 can easily become familiar with the quicc since the cpm architectural approach remains intact. the most significant architectural change made on the quicc was the translation of the design into the standard m68300 family imb architecture, resulting in a faster cpu and dif- ferent system integration features. although the features of the sim60 do not exactly correspond to those of the mc68302 sim, they are very similar. the quicc sim60 combines the best mc68302 sim features with the best mc68340 sim features for improved performance.
introduction motorola mc68360 user? manual 1-7 because of the similarity of the quicc sim60 and cpu to other members of the m68300 family, such as the mc68332 and the mc68340, previous users of these devices will be comfortable with these same features on the quicc. 1.3.2 hardware compatibility issues the following list summarizes the hardware differences between the mc68302 and the quicc: pinout?he pinout is not the same. the quicc has 240 pins; the mc68302 has 132 pins. package?oth devices offer pga and pqfp packages. however, the quicc pqfp package has a 20-mil pitch; whereas, the mc68302 pqfp package has a 25-mil pitch. system bus?he system bus signals now look like those of the mc68030 as opposed to those of the m68000. it is still possible to interface m68000 peripherals to the quicc, utilizing the same techniques used to interface them to an mc68020 or mc68030. system bus in slave mode? number of quicc pins take on new functionality in slave mode to support an external mc68ec040. on the mc68302, the pin names generally remained the same in slave mode. peripheral timing?he external timings of the peripherals (sccs, timers, etc.) are very similar (if not identical) to corresponding peripherals on the mc68302. pin assignments?he assignment of peripheral functions to i/o pins is different in sev- eral ways. first, the quicc contains more general-purpose parallel i/o pins than the mc68302. however, the quicc offers many more functions than even a 240-pin pack- age would normally allow, resulting in more multifunctional pins than the mc68302. 1.3.3 software compatibility issues the following list summarizes the major software differences between the mc68302 and the quicc: since the cpu32+ is a superset of the m68000 instruction set, all previously written code will run. however, if such code is accessing the mc68302 peripherals, it will re- quire some modification. the quicc contains an 8-kbyte block of memory as opposed to a 4-kbyte block on the mc68302. the register addresses within that memory map are different. the code used to initialize the system integration features of the mc68302 has to be modified to write the corresponding features on the quicc sim60. code written for the mc68340 may be adapted in large part. as much as possible, quicc cpm features were made identical to those of the mc68302 cp. the most important benefit is that the code flow (if not the code itself) will port easily from the mc68302 to the quicc. the nuances learned from the mc68302 will still be useful in the quicc. although the registers used to initialize the quicc cpm are new (for example, the scm on the mc68302 is replaced with the gsmr and psmr on the quicc), most registers retain their original purpose such as the scc event, scc mask, scc status, and com-
introduction 1-8 mc68360 user? manual motorola mand registers. the parameter ram of the sccs is very similar, and most parameter ram register names and usage are retained. more importantly, the basic structure of a buffer descriptor (bd) on the quicc is identical to that of the mc68302, except for a few new bit functions that were added. (in a few cases, a bit in a bd status word had to be shifted.) when porting code from the mc68302 cp to the quicc cpm, the software writer may find that the quicc has new options to simplify what used to be a more code-intensive process. for specific examples, see the init tx and rx parameters, graceful stop transmit, and close bd commands. 1.4 quicc glueless system design a fundamental design goal of the quicc was ease of interface to other system components. an example of this goal is a minimal quicc design using eprom and dram, shown in fig- ure 1-2. this system interfaces gluelessly to an eprom and a dram simm module. it also offers parity support for the dram. figure 1-2. minimum quicc system configuration figure 1-3 shows a larger system configuration. this system offers one eprom, one flash eprom, and supports two dram simms. depending on the capacitance on the system bus, external buffers may be required. from a logic standpoint, however, a glueless system is maintained. quicc mc68360 ce (enable) oe (output enable) we (write) data address 8-bit boot eprom (flash or regular) cs0 oe we0 data address ras cas3?as0 w (write) data address parity 16- or 32-bit dram simm (optional parity) ras1 cas3?as0 r/w prty3?rty0
introduction motorola mc68360 user? manual 1-9 figure 1-3. larger quicc system configuration 1.5 quicc serial configurations the quicc offers an extremely flexible set of communications capabilities. although a full understanding of the possibilities requires reading the appropriate sections, some of the possibilities are shown in the following diagrams. they show possible connections between quicc devices. in addition, connections are often shown between quiccs and the mc68302 to show the compatibility between these devices. for readability, transceivers are usually omitted in the following diagrams. for local on- board communications, however, transceivers are often optional and depend on the proto- col used. figure 1-4 shows the ethernet lan capability of the quicc. an external sia transceiver is required to complete the interface to the media. this functionality is implemented in the mc68160 enhanced ethernet serial transceiver (eest ? ). the mc68160 eest supports quicc mc68360 ce (enable) oe (output enable) we (write) data address 8-bit boot eprom (flash or regular) cs0 oe we0 data address ras cas3?as0 w (write) data address parity 16- or 32-bit two dram simms (optional parity) ras1 cas3?as0 r/w ras buffer e (enable) g (output enable) w (write) data address 8-, 16-, or 32-bit sram cs7 we3?e0 ras2 prty3?rty0
introduction 1-10 mc68360 user? manual motorola connections to the attachment unit interface (aui) or twisted-pair ethernet formats and pro- vides a glueless interface to the quicc. figure 1-4. ethernet lan capability figure 1-5 shows the appletalk lan capability of the quicc. note that the mc68302 requires an extra device, the mc68195 localtalk adapter, to interface to appletalk. figure 1-5. appletalk lan capability figure 1-6 shows the implementation of a lan structure of hdlc called hdlc bus. this protocol is the fastest, easiest way to interface multiple quiccs in an hdlc-based protocol. quicc quicc quicc scc1 ethernet scc1 scc1 mc68160 eest mc68160 eest mc68160 eest quicc quicc scc scc scc note: the quicc implements the appletalk lan protocol without the need for the mc68195. mc68302 mc68195 la rs422 xcvr rs422 xcvr rs422 xcvr
introduction motorola mc68360 user? manual 1-11 figure 1-6. hdlc bus lan figure 1-7 shows the original sdlc application, which can be implemented by both quiccs and mc68302s. figure 1-7. fsdlc bus implementation figure 1-8 shows a uart lan configuration that is supported by both the quicc and the mc68302, as well as many other industry uarts. quicc quicc quicc scc scc scc hdlc bus notes: 1. hdlc bus?ny node can obtain mastership. 2. the quicc handles collisions without external glue. note: no collisions are allowed in this master-slave approach. also available on the mc68302. quicc quicc mc68302 scc scc scc sdlc bus
introduction 1-12 mc68360 user? manual motorola figure 1-8. uart lan implementation figure 1-9 shows how the spis on the quicc can be used to connect devices together into a local bus. the spi exists on many other motorola devices, such as the mc68hc11 micro- controller, and a number of peripherals such as a/d and d/a converters, led drivers, lcd drivers, real-time clocks, serial eeprom, pll frequency synthesizers, and shift registers. figure 1-9. spi local bus implementation quicc quicc mc68302 scc scc scc multi-drop uart notes: 1. simple lan based on uart mode. 2. ninth bit is an "address" bit. quicc spi master/slave quicc spi master/slave quicc spi master/slave spi bus note: spi bus configuration?ach quicc can be the master in turn.
introduction motorola mc68360 user? manual 1-13 figure 1-10 shows how the scp on the mc68302 can be used to interface to the quicc spi. figure 1-10. spi implementation using scp figure 1-11 shows how the spi on the quicc can interface to another quicc or spi-based peripherals. figure 1-11. spi master-slave implementation figure 1-12 shows how the parallel interface port (pip) can be used to implement the cen- tronics interface connection. the quicc may be the peripheral or the host. figure 1-12. centronics interface implementation eeproms etc. spi slave mc68302 quicc scp master spi slave spi bus note: the mc68302 scp can communicate with the quicc spi. quicc quicc spi master spi slave spi bus eeproms etc. spi slave note: two quiccs configured for a master-slave spi connection. quicc pip host computer or printer note: the quicc can communicate over a centronics interface. centronics interface 8 data lines
introduction 1-14 mc68360 user? manual motorola figure 1-13 shows how the pip can also be used to implement a fast parallel connection between devices. figure 1-13. fast parallel connection implementation figure 1-14 shows which scc protocols may be used to connect sccs on the quicc and the mc68302. figure 1-14. scc protocol implementation figure 1-15 shows which scc protocols may be used to connect sccs on multiple quiccs or to other devices supporting such protocols. figure 1-15. multiple quicc point-to-point implementation figure 1-16 shows other point-to-point options that are possible with the quicc and the mc68302. quicc pip parallel interface 8 data lines pip quicc note: fast parallel connection between quiccs. quicc mc68302 scc scc hdlc/sdlc bisync uart transparent quicc quicc scc scc note: point-to-point (wan) configurations are available on the quicc. hdlc/sdlc bisync uart transparent synchronous uart ss#7
introduction motorola mc68360 user? manual 1-15 figure 1-16. other point-to-point implementations figure 1-17 shows how up to six of the serial channels can connect to a tdm interface. the quicc provides a built-in time-slot assigner for access to the tdm time slots. other chan- nels can work with their own set of pins, allowing possibilities like an ethernet to t1 bridge, etc. figure 1-17. serial channel to tdm bus implementation figure 1-18 shows that the quicc time-slot assigner can support two tdm buses. each tdm bus can be of a different format?or example, one tdm can be a t1 line, and one can be a cept line. also this technique could be used to bridge frames from basic rate isdn to a t1/cept line, etc. quicc mc68302 smc scc quicc quicc smc smc uart transparent quicc mc68302 smc scp transparent uart transparent quicc time division multiplexed bus t1, cept, idl, gci, isdn, primary rate, user-defined time slot assigner scc scc scc scc smc smc any combination of sccs and smcs may be connected to the tdm. note: independent receive and transmit clocking, routing, and syncs are supported.
introduction 1-16 mc68360 user? manual motorola figure 1-18. dual tdm bus implementation 1.6 quicc serial configuration examples figure 1-19 shows a situation where multiple quiccs can communicate over a tdm line. this can be used, for instance, to implement an 8-channel line card. the sccs implement the line interfaces, and the smcs provide the local on-board communication between the quiccs. the additional smc on each quicc can be used as a serial debug port. the spi can be used to interface to peripherals, such as a serial eeprom. figure 1-19. multiple quicc tdm bus implementation quicc time slot assigner scc scc scc scc smc smc any combination of sccs and smcs may be connected to any tdm. tdm bus 1 tdm bus 2 note: two tdm buses may be simultaneously supported with the time slot assigner. quicc time slot assigner scc scc scc scc smc smc tdm bus quicc time slot assigner scc scc scc scc smc smc two smcs are used to communicate locally between quiccs over a time slot. note: the eight sccs and two smcs support 10 time slots on the tdm bus. the length and position of the time slots are made with time slot assigners.
introduction motorola mc68360 user? manual 1-17 figure 1-20 shows a general-purpose application that includes ethernet, appletalk, an hdlc connection to a t1 line, an hdlc connection to frame relay, a uart debug monitor port, a totally transparent data stream port, and an spi connection to a serial eeprom. figure 1-20. general-purpose application 1.7 quicc system bus configurations figure 1-21 shows a master-slave quicc configuration. this system gives eight sccs, four smcs, two spis, four idmas, etc. each quicc uses its own dma capability, but the cpu32+ is the only processor in the system. more quiccs can be easily supported on the system bus, if desired. figure 1-21. master-slave quicc implementation quicc scc1 scc2 scc3 scc4 smc2 spi ethernet rs-422 apple talk t1 line transceiver x.25 (hdlc) rs-232 frame relay (hdlc) rs-232 debug port uart serial eeprom system bus time slot assigner smc1 rs-232 transparent data motorola sia transceiver quicc master quicc slave cpu32+ quicc system bus scc scc scc scc smc smc spi scc scc scc scc smc smc spi cpu32+
introduction 1-18 mc68360 user? manual motorola the quicc has special features in slave mode to support the m68040 family. when the quicc is used in this way, it is said to be in mc68040 companion mode. figure 1-22 shows how a quicc in slave mode can interface to a mc68ec040. (the mc68ec040 is a low- cost version of the mc68040 with identical integer performance, but without the memory management unit (mmu) and the floating-point unit (fpu).) the dram controller on the quicc will control the accesses of the mc68ec040 (including the burst modes). this con- figuration does require external address multiplexers, but the quicc controls the multiplex- ers. the quicc supports the mc68ec040 in other ways, such as interrupt handling and system protection features. when it is in slave mode, the quicc can also be interfaced to any mc68030-type bus master instead of the mc68ec040. figure 1-22. mc68040 companion mode mc68ec040 quicc slave cpu32+ system bus scc scc scc scc smc smc spi memory controller control address muxs sram mc68ec040 support functions eprom dram
motorola mc68360 user? manual 2-1 section 2 signal descriptions this section contains brief descriptions of the quicc input and output signals in their func- tional groups as shown in figure 2-1. 2.1 system bus signal index the quicc system bus signals consist of two groups. the first group, listed in table 2-1, consists of system bus signals that exist when the quicc is in the normal mode (cpu32+ enabled). the second group consists of system bus signals that exist when the quicc is in the slave mode (cpu32+ disabled). they are listed in table 2-7 and may also be identified in figure 2-1 as those with an italic font. in table 2-1, the signal name, mnemonic, and a brief functional description are presented. for more detail on each signal, refer to the para- graphs that discuss each signal. 2.1.1 address bus the address bus consists of the following two groups. refer to section 4 bus operation for information on the address bus and its relationship to bus operation. 2.1.1.1 address bus (a27?0). this three-state bidirectional bus (along with a31?28) provides the address for the current bus cycle, except in the cpu address space. refer to section 4 bus operation for more information on the cpu address space. a27 is the most significant address signal in this group. 2.1.1.2 address bus (a31?28). these pins can be programmed as the most signifi- cant four address bits or as four byte write enables. a31?28?hese pins can function as the most significant 4 address bits. a31 is the most significant address signal in this group. we3 ?e0 ?n a write cycle, these active-low signals indicates which byte of the 32- bit data bus contains valid data. we0 ?orresponds to a31 and selects data bits 31?4. also may be referred to as uu- we. we1 ?orresponds to a30 and selects data bits 23?6. also may be referred to as um- we. we2 ?orresponds to a29 and selects data bits 15?. also may be referred to as lmwe. we3 ?orresponds to a28 and selects data bits 7?. also may be referred to as llwe. thi d t t d ith f m k 4 0 4
signal descriptions 2-2 mc68360 user? manual motorola note write enable does not have the capability to follow dynamic bus sizing with external assertion of dsack . write enable will al- ways follow the port size that is programed in gmr and the or. for more information see 6.10 memory controller. figure 2-1. quicc functional signal groups d31?16 address bus bus control bus arbitration system control interrupt control test clock txd1/pa1 brgclk1/tout1/clk2/pa9 port b (pip) timers/sccs/sis/clocks/brg memory controller port a rxd1/pa0 rxd2/pa2 txd2/pa3 l1txdb/rxd3/pa4 l1rxdb/txd3/pa5 l1txda/rxd4/pa6 l1rxda/txd4/pa7 tin1/l1rclka/brgo1/clk1/pa8 tin2/l1tclka/brgo2/clk3/pa10 tout2/clk4/pa11 tin3/brgo3/clk5/pa12 b rgclk2/l1rclkb/tout3/clk6/pa13 tin4/brgo4/clk7/pa14 l1tclkb/tout4/clk8/pa15 rrjct1/spisel/pb0 rstrt2/spiclk/pb1 rrjct2/spimosi(spitxd)/pb2 brgo4/spimiso(spirxd)/pb3 dreq1/brgo1/pb4 dack1/brgo2/pb5 done1/smtxd1/pb6 done2/smrxd1/pb7 dreq2/smsyn1/pb8 dack2/smsyn2/pb9 l1clkob/smtxd2/pb10 l1clkoa/smrxd2/pb11 l1st1/rts1/pb12 l1st2/rts2/pb13 l1st3/l1rqb/rts3/pb14 l1st4/l1rqa/rts4/pb15 strbo/brgo3/pb16 strbi/rstrt1/pb17 l1st1/rts1/pc0 l1st2/rts2/pc1 l1st3/l1rqb/rts3/pc2 l1st4/l1rqa/rts4/pc3 cts1/pc4 tgate1/cd1/pc5 cts2/pc6 tgate2/cd2/pc7 sdack2/l1tsyncb/cts3/pc8 l1rsyncb/cd3/pc9 sdack1/l1tsynca/cts4/pc10 l1rsynca/cd4/pc11 port c (interrupt parallel i/o) clko2?lko1 modck1?odck0 xfc extal xtal trst tdo tdi tms tck ifetch/ badd3 /dsi ipipe0/ badd2 /dso ipipe1/ras1dd/ bclri freeze/config2/ mbare bkpt/ bkpto /dsclk tris/ ts cas3?as0/iack6,3,2,1 cs/ras7/iack7 cs6?s0/ras6?as0 avec/iack5/ aveco irq2,3,5,7 irq6/ iout2 irq4/ iout1 irq1/ iout0/rqout perr berr/ tea halt resets reseth bclro/config1/ras2dd bgack/ bb bg br rmc/config0/ lock oe/amux ds/ tt1 as r/w dsack1/ ta dsack0/ tbi siz1 siz0 data bus prty3/16bm prty2/ iout0 / rqout d15?0 prty1?rty0/ iout1?out 2 a27?0 a31?28/we3?e0 fc2?c0/ tm2?m0 fc3/ tt0 quicc mc68360 240 pins
signal descriptions motorola mc68360 user? manual 2-3 table 2-1. system bus signal index (normal operation) group signal name mnemonic function address address bus a27?0 lower 27 bits of address bus. (i/o) address bus/byte write enables a31?28/ we0 ?e3 upper four bits of address bus (i/o), or byte write enable sig- nals (o) for accesses to external memory or peripherals. function codes fc3?c0 identifies the processor state and the address space of the current bus cycle. (i/o) data data bus 31?6 d31?16 upper 16-bit data bus used to transfer byte or word data. used in 16-bit bus mode (i/o). data bus 15? d15?0 lower 16-bit data bus used to transfer 3-byte or long-word data (i/o). not used in 16-bit bus mode. parity parity 2? prty2?rty0 parity signals for byte writes/reads from/to external memory module (i/o). parity3/16bm prty3/16bm parity signals for byte writes/reads from/to external memory module or defines 16-bit bus mode. (i/o) parity error perr indicates a parity error during a read cycle. (o) memory controller chip select/row ad- dress select 7/ interrupt acknowl- edge 7 cs /ras7 /iack7 enables peripherals or drams at programmed addresses (o) or interrupt level 7 acknowledge line (o). chip select 6?/ row address select 6? cs6 ?s0 / ras6 ?as0 enables peripherals or drams at programmed addresses. (o) column address se- lect 3?/interrupt ac- knowledge 1, 2, 3, 6 cas3 -cas0 / iack6 ,3 ,2 ,1 dram column address select or interrupt level acknowledge lines. (o) bus arbitration bus request br indicates that an external device requires bus mastership. (i) bus grant bg indicates that the current bus cycle is complete and the quicc has relinquished the bus. (o) bus grant acknowl- edge bgack indicates that an external device has assumed bus master- ship. (i) read-modify-write cycle/initial configu- ration 0 rmc /config0 identifies the bus cycle as part of an indivisible read-modify- write operation (i/o) or initial quicc configuration select (i). bus clear out/ initial configuration 1/row address se- lect 2 double-drive bclro /config1/ ras2dd indicates that an internal device requires the external bus (open-drain o) or initial quicc configuration select (i) or row address select 2 double-drive output (o). bus control data and size ac- knowledge dsack1 ?sack0 provides asynchronous data transfer acknowledgement and dynamic bus sizing (open-drain i/o but driven high before three-stated). address strobe as indicates that a valid address is on the address bus. (i/o) data strobe ds during a read cycle, ds indicates that an external device should place valid data on the data bus. during a write cycle, ds indicates that valid data is on the data bus. (i/o) size siz1?iz0 indicates the number of bytes remaining to be transferred for this cycle. (i/o) read/write r/w indicates the direction of data transfer on the bus. (i/o) output enable/ address multiplex oe /amux active during a read cycle indicates that an external device should place valid data on the data bus (o) or provides a strobe for external address multiplexing in dram accesses if internal multiplexing is not used (o). interrupt control interrupt request level 7? irq7 ?rq1 provides external interrupt requests to the cpu32+ at prior- ity levels 7?. (i) autovector/interrupt acknowledge 5 avec /iack5 autovector request during an interrupt acknowledge cycle (open-drain i/o) or interrupt level 5 acknowledge line (o).
signal descriptions 2-4 mc68360 user? manual motorola ) note: i denotes input, 0 denotes output, and i/o is input/output. table 2-1. system bus signal index (normal operation)(continued) group signal name mnemonic function system control soft reset resets sft system reset. (open-drain i/o) hard reset reseth hard system reset. (open-drain i/o) halt halt suspends external bus activity. (open-drain i/o) bus error berr indicates an erroneous bus operation is being attempted. (open-drain i/o) clock and test system clock out 1 clko1 internal system clock output 1. (o) system clock out 2 clko2 internal system clock output 2?ormally 2x clko1. (o) crystal oscillator extal, xtal connections for an external crystal to the internal oscillator circuit. extal (i), xtal (o). external filter ca- pacitor xfc connection pin for an external capacitor to filter the circuit of the pll (i). clock mode select 1? modck1?odck0 selects the source of the internal system clock. (i) these pins should not be set to 00 instruction fetch/ development serial input ifetch /dsi indicates when the cpu32+ is performing an instruction word prefetch (o) or input to the cpu32+ background debug mode (i). instruction pipe 0/ development serial output ipipe0 /dso used to track movement of words through the instruction pipeline (o) or output from the cpu32+ background debug mode (o). instruction pipe 1/ row address select 1 double-drive ipipe1 /ras1dd used to track movement of words through the instruction pipeline (o), or a row address select 1 ?ouble-drive?output (o). clock and test (cont'd) breakpoint/ development serial clock bkpt /dsclk signals a hardware breakpoint to the quicc (open-drain i/ o), or clock signal for cpu32+ background debug mode (i). freeze/initial config- uration 2 freeze/ config2 indicates that the cpu32+ has acknowledged a breakpoint (o), or initial quicc configuration select (i). three-state tris used to three-state all pins if quicc is configured as a mas- ter. sampled during system reset. (i) test clock tck provides a clock for scan test logic. (i) test mode select tms controls test mode operations. (i) test data in tdi serial test instructions and test data signal. (i) test data out tdo serial test instructions and test data signal. (o) test reset trst provides an asynchronous reset to the test controller. (i) power clock synthesizer power vccsyn power supply to the pll of the clock synthesizer. clock synthesizer ground gndsyn ground supply to the pll of the clock synthesizer. clock out power vccclk power supply to clock out pins. clock out ground gndclk ground supply to clock out pins. special ground 1 gnds1 special ground for fast ac timing on certain system bus sig- nals. special ground 2 gnds2 special ground for fast ac timing on certain system bus sig- nals. system power sup- ply and return vcc, gnd power supply and return to the quicc. no connect nc4?c1 four no-connect pins.
signal descriptions motorola mc68360 user? manual 2-5 2.1.2 function codes (fc3?c0) these three-state bidirectional signals identify the processor state and the address space of the current bus cycle as noted in table 2-2. the function code pins provide the purpose of each bus cycle to external logic. other bus masters besides the quicc may also output function codes during their bus cycles. on the quicc, this capability is provided for each potential internal bus master (i.e., the idma, sdma, and dram refresh units). provision is also made for the decoding of func- tion codes that are output from external bus masters (e.g., in the memory controller chip- select generation logic). in computer design, function code information can be used to protect certain portions of the address map from unauthorized access or to extend the addressable range beyond the address limit. however, in controller applications, function codes are most often used as a debugging aid. furthermore, in most controller applications, the quicc stays continuously in the supervisor state. refer to section 4 bus operation for more information. note fc3-0 may not be set to 0xf 2.1.3 data bus the data bus consists of the following two groups. refer to section 4 bus operation for infor- mation on the data bus and its relationship to bus operation. 2.1.3.1 data bus (d31?16). these three-state bidirectional signals (along with d15 d0) provide the general-purpose data path between the quicc and all other devices. although the data path is a maximum of 32 bits wide, it can be dynamically sized to support 8-, 16-, or 32-bit transfers. d31 is the msb of the data bus. byte and word operations occur on d31?16. additionally, if the quicc is configured into 16-bit bus mode, the d31?16 table 2-2. address space encoding function code bits 3210 address space 0000 reserved (motorola) 0001 user data space 0010 user program space 0011 reserved (user) 0100 reserved (motorola) 0101 supervisor data space 0110 supervisor program space 0111 supervisor cpu space 1 x x x dma space
signal descriptions 2-6 mc68360 user? manual motorola pins are the only data pins used. refer to section 4 bus operation for information on the data bus and its relationship to bus operation. 2.1.3.2 data bus (d15?0). these pins can function as 16 additional data pins used in long-word and 3-byte transfers. they are three-stated and not used if the quicc is config- ured into 16-bit bus mode. 2.1.4 parity these three-state bidirectional signals provide parity generation/checking for the data path between the quicc or external masters and other devices. there are four parity lines?ne for every eight data bits. the parity lines consists of two groups. refer to section 6 system integration module (sim60) for more information on parity generation/checking. 2.1.4.1 parity (prty0). this pin is the parity value for data bits 31?4. 2.1.4.2 parity (prty1). this pin is the parity value for data bits 23?6. 2.1.4.3 parity (prty2). this pin is the parity value for data bits 15?. 2.1.4.4 parity (prty3). this pin has two functions. during total system reset, it is the 16bm pin to determine whether 16-bit data bus mode is to be enabled. after system reset, it functions as the parity line 3. prty3?his pin is the parity value for data bits 0?. 16bm ?his pin selects the 16-bit data bus mode. to choose a 32-bit data bus during total system reset, this pin can be left floating (it has an internal pullup resistor) or can be driven/ pulled high. to choose a 16-bit data bus during total system reset, this pin should be driven/ pulled low. 2.1.5 memory controller the following signals are used to control an external memory device. 2.1.5.1 chip select/row address select (cs6 ?s0 /ras6 ?as0 ). the chip- select output signals enable peripherals or memory arrays at programmed addresses. cs0 is the global chip select for the boot rom containing the user? reset vector and initialization program. refer to section 6 system integration module (sim60) for more information on chip selects. note in addition, ras1 can be simultaneously output on the ras1dd pin to increase the ras1 line drive capability, and ras2 can be simultaneously output on the ras2dd pin to increase the ras2 line drive capability. 2.1.5.2 chip select/row address select/interrupt acknowledge (cs7 / ras7 /iack7 ). this pin can be programmed as a cs7 /ras7 pin or as the iack7 line. see section 6 system integration module (sim60) for more information on this selection.
signal descriptions motorola mc68360 user? manual 2-7 ras7 /cs7 ?ow address select 7 or chip select 7 output signal. iack7 ?he quicc asserts this pin to indicate a level 7 external interrupt during an inter- rupt acknowledge cycle. peripherals can use the iackx strobes instead of monitoring the address bus and function codes to determine that an interrupt acknowledge cycle is in progress and to obtain the current interrupt level. iackx lines need not be used when the vector is generated internally by the quicc. see section 4 bus operation for more informa- tion. 2.1.5.3 column address select/interrupt acknowledge (cas3 ?as0 / iack6 , 3 , 2 , 1 ). these pins can be programmed as four column address selects for drams or as interrupt acknowledge lines. cas3 ?as0 ?he dram column address select output signal enables the dram col- umns: cas0 selects data bits 31?4. cas1 selects data bits 23?6. cas2 selects data bits 15?. cas3 selects data bits 7?. iack1 , iack2 , iack3 , iack6 ?he quicc asserts one of these pins to indicate the level of an external interrupt during an interrupt acknowledge cycle. peripherals can use the iackx strobes instead of monitoring the address bus and function codes to determine that an interrupt acknowledge cycle is in progress and to obtain the current interrupt level. iackx lines need not be used when the vector is generated internally by the quicc. see section 4 bus operation for more information. iack1 corresponds to cas0 . iack2 corresponds to cas1 . iack3 corresponds to cas2 . iack6 corresponds to cas3 . 2.1.5.4 address multiplex (amux). see 2.1.7.7 output enable/address multiplex (oe/amux) for more information. 2.1.6 interrupt request level ( irq7 irq1 ) these pins are prioritized interrupt request lines. irq7 , the highest priority, is nonmaskable; irq6 ?rq1 are internally maskable interrupts. refer to section 5 cpu32+ for more infor- mation on the interrupt request lines. 2.1.7 bus control signals these signals control the bus transfer operations of the quicc. refer to section 4 bus operation for more information on these signals.
signal descriptions 2-8 mc68360 user? manual motorola 2.1.7.1 data and size acknowledge (dsack1 ?sack0 ). these two active-low bidirectional signals allow asynchronous data transfers and dynamic data bus sizing between the quicc and external devices (see table 2-3). 2.1.7.2 autovector/interrupt acknowledge (avec /iack5 ). this pin can be programmed to be an autovector input or the interrupt acknowledge 5 line output. avec ?his signal requests an automatic vector during an interrupt acknowledge cycle. refer to section 6 system integration module (sim60) for more information on the autovec- tor function. avec need not be used if the quicc supplies the vector internally. iack5 ?he quicc asserts this pin to indicate the level of an external interrupt during an interrupt acknowledge cycle at level 5. peripherals can use the iackx strobes instead of monitoring the address bus and function codes to determine that an interrupt acknowledge cycle is in progress and to obtain the current interrupt level. iackx lines need not be used when the vector is generated internally by the quicc. 2.1.7.3 address strobe (as ). this bidirectional signal is driven by the bus master to indicate a valid address on the address bus. the function code, size, and read/write signals are also valid when as is asserted. 2.1.7.4 data strobe (ds ). during a read cycle, this input/output signal is driven by the bus master to indicate that an external device should place valid data on the data bus. dur- ing a write cycle, the data strobe indicates that valid data is on the data bus. 2.1.7.5 transfer size (siz1, siz0). these bidirectional signals are driven by the bus master to indicate the number of operand bytes remaining to be transferred in the current bus cycle (see table 2-4). 2.1.7.6 read/write (r/w ). this active-high bidirectional signal is driven by the bus mas- ter to indicate the direction of data transfer on the bus. a logic one indicates a read from a slave device; a logic zero indicates a write to a slave device. table 2-3. dsackx encoding dsack1 dsack0 result 1 (negated) 1 (negated) insert wait states in current bus cycle. 1 (negated) 0 (asserted) complete cycle?ata bus port size is 8 bits. 0 (asserted) 1 (negated) complete cycle?ata bus port size is 16 bits. 0 (asserted) 0 (asserted) complete cycle?ata bus port size is 32 bits. table 2-4. sizx encoding siz1 siz0 transfer size 0 1 byte 1 0 word 1 1 3 bytes 0 0 long word
signal descriptions motorola mc68360 user? manual 2-9 2.1.7.7 output enable/address multiplex (oe /amux). this pin can be pro- grammed as the output enable (oe ) output or as the address multiplex output. oe ?uring a read cycle, this output signal is driven by the bus master to indicate that an external device should place valid data on the data bus. oe may used to save an external inversion of the r/w signal. amux?his output signal is driven by the dram controller to the external address multi- plexer. amux need not be used if the dram addresses are multiplexed internally by the quicc. 2.1.7.8 byte write enable (we3 ?e0 ) . see 2.1.1.2 address bus (a31?28) for the description. 2.1.8 bus arbitration signals the following signals are the four bus arbitration control signals used to determine the bus master. refer to section 4 bus operation for more information concerning these signals. 2.1.8.1 bus request (br ). this active-low input signal indicates that an external device needs to become the bus master. this input is typically wire-ored. 2.1.8.2 bus grant (bg ). assertion of this active-low output signal indicates that the bus master has relinquished the bus. 2.1.8.3 bus grant acknowledge (bgack ). assertion of this active-low input indi- cates that an external device has become the bus master. 2.1.8.4 read-modify-write cycle/initial configuration (rmc /config0). this pin can be programmed as the read-modify-write cycle output or as the initial configu- ration pin 0 input signal during system reset. rmc ?his output signal identifies the bus cycle as part of an indivisible read-modify-write operation; it remains asserted during all bus cycles of the read-modify-write operation to indicate that bus ownership cannot be transferred. note rmc is muxed with a config0 pin. rmc only functions when the cpu32+ is enabled, and is an output unless an external master ownes the bus, in which case it is an input. config0?ee 2.1.13 initial configuration pins (config) for the description. 2.1.8.5 bus clear out/initial configuration/row address select double-drive (bclro /config1/ras2dd ). this pin can be programmed as the bus clear out output or as the initial configuration pin 1 input signal during system reset or as the ras2dd output double-drive signal.
signal descriptions 2-10 mc68360 user? manual motorola bclro ?his active-low open-drain output indicates that one of the quicc internal bus masters is requesting the external bus master to release the bus. config1?ee 2.1.13 initial configuration pins (config) for the description. ras2 ?ee 2.1.5.1 chip select/row address select (cs6?s0/ras6?as0) for the description. 2.1.9 system control signals the quicc uses these signals to recover from an exception. refer to section 4 bus oper- ation for more information on these signals. 2.1.9.1 soft reset (resets ). this active-low, open-drain, bidirectional signal is used to initiate reset. an external reset signal (as well as a reset from the sim60) resets the quicc as well as all external devices. a reset signal from the cpu32+ (asserted as part of the reset instruction) resets external devices only?he internal state of the cpu32+ is not affected; other on-chip modules are reset, but the configuration is not altered. when asserted by the quicc, this signal is guaranteed to be asserted for a minimum of 512 clock cycles. for more information see 4.7 reset operation. 2.1.9.2 hard reset (reseth ). this active-low, open-drain, bidirectional signal is used to initiate reset. an external hard reset signal (as well as an hard reset from the sim60) resets the quicc as well as all external devices and the internal state of the cpu32+; other on-chip modules are reset as well as the quicc configuration. when asserted by the quicc, this signal is guaranteed to be asserted for a minimum of 512 clock cycles. for more information see 4.7 reset operation. during a hard reset, the address, data, and bus control pins are all three-stated. the bg pin output is the same as that on the br input. the general-purpose i/o pins are all configured as inputs. the nc4?c1 pins are undefined outputs. the xtal, clko1, and clko2 pins are active outputs, except for clko1 which does not oscillate while the on-chip pll is attaining a lock. the resets pin is an output. 2.1.9.3 halt (halt ). this active-low, open-drain, bidirectional signal is asserted to sus- pend external bus activity, to request a retry when used with berr , or to perform a single- step operation. as an output, halt indicates a double bus fault by the cpu32+. 2.1.9.4 bus error (berr ). this active-low, open-drain, bidirectional signal indicates that an invalid bus operation is being attempted or, when used with halt , that the bus mas- ter should retry the current cycle. 2.1.10 clock signals these signals are used by the quicc for controlling or generating the system clocks. refer to section 6 system integration module (sim60) for more information on these clock signals. 2.1.10.1 system clock outputs (clko2?lko1). these output signals reflect the general system clock and are used as the bus timing reference by external devices. clko1
signal descriptions motorola mc68360 user? manual 2-11 is the general system clock. clko2 is 2 clko1 if the on-chip clock synthesizer pll is used, and is 1 clko1 otherwise. 2.1.10.2 crystal oscillator (extal, xtal). these two pins are the connections for an external crystal to the internal oscillator circuit. if an external oscillator is used, it should be connected to extal, with xtal left open. 2.1.10.3 external filter capacitor (xfc). this pin is used to add an external capacitor to the filter circuit of the pll. the capacitor should be connected between xfc and vccsyn. 2.1.10.4 clock mode select (modck1?odck0). the state of these active-high input signals during reset selects the type of external clock that is used by the pll in the clock synthesizer to generate the system clocks. table 2-5 lists the default values of the pll. 1 this mode is reserved. 2.1.11 instrumentation and emulation signals these signals are used for test or software debugging. refer to section 5 cpu32+ for more information on these signals. 2.1.11.1 instruction fetch/development serial input (ifetch /dsi ). this active-low output signal indicates when the cpu32+ is performing an instruction word prefetch and when the instruction pipeline has been flushed. additionally, this signal is the serial input to the cpu32+ in its background debug mode to issue background commands, etc. 2.1.11.2 instruction pipe/development serial output (ipipe0/dso). this active-low output signal is used to track movement of words through the instruction pipeline. additionally, this signal is the serial output from the cpu32+ in its background debug mode to issue background status, etc. 2.1.11.3 instruction pipe/row address select double-drive (ipipe1/ ras1dd). this active-low output signal is used to track movement of words through the instruction pipeline. this signal also functions as a second output of the ras1 signal to increase fanout capability. 2.1.11.4 breakpoint/development serial clock (bkpt /dsclk). this active- low input signal is used to signal a hardware breakpoint to the cpu32+. additionally, this table 2-5. default operation mode of the pll modck 1? pll prescaled by 128 multi. factor (mf + 1) extal freq. (examples) clkin to the pll initial freq. (vco/2) 00 1 disabled reserved reserved reserved reserved reserved 01 enabled no 1 >10 mhz =extal =extal 10 enabled yes 401 4.192 mhz 32.75 khz 13.14 mhz 11 enabled no 401 32.768 khz 32.768 khz 13.14 mhz
signal descriptions 2-12 mc68360 user? manual motorola signal is the serial clock used to transfer commands/status to and from the cpu32+ during background debug mode. 2.1.11.5 freeze/initial configuration (freeze/config2). this pin can be pro- grammed as the freeze output or as the initial configuration pin 2 input signal during system reset. freeze?ssertion of this active-high output signal indicates that the cpu32+ has acknowledged a breakpoint and has initiated background mode operation. config2?ee 2.1.13 initial configuration pins (config) for the description. 2.1.12 test signals the following signals are used with the on-board test logic . see section 8 scan chain test access port for more information on the use of these signals. 2.1.12.1 tri-state signal (tris ). tthe tris pin is enabled as a tristate control pin only when the cpu32+ is enabled, and it is not sampled during reset. when asserted, tris immediately tristates the pins. 2.1.12.2 test reset (trst ). this input provides asynchronous reset to the test logic. 2.1.12.3 test clock (tck). this input provides a clock for on-board test logic. 2.1.12.4 test mode select (tms). this input controls test mode operations for on- board test logic. 2.1.12.5 test data in (tdi). this input is used for serial test instructions and test data for on-board test logic. 2.1.12.6 test data out (tdo). this output is used for serial test instructions and test data for on-board test logic. 2.1.13 initial configuration pins (config) the config2?onfig0 pins select the quicc initial configuration during reset (see table 2-6). they decide whether the cpu32+ core will be enabled or disabled, the global chip select port will be 8-, 16-, or 32-bits, and the mbar address will be $003ff00 or $0033ff04. after reset, these pins may be programmed to their other function. the config2?onfig0 lines have internal pullup resistors so that if they are left floating, the default selection will be 111. see section 6 system integration module (sim60) for more information.
signal descriptions motorola mc68360 user? manual 2-13 note all config pins do have an internal pull-up resistor during re- set. if a configuration other than the default (config2-1 = 111) is desired, these pins should be driven by an active open collec- tor device during the assertion of reseth. 2.1.14 power signals the following signals are used for power and ground to the quicc. 2.1.14.1 vccsyn and gndsyn. these pins provide power and ground to the clock syn- thesizer. they should be bypassed to each other with a 0.1- m f capacitor. see the system clock generation description in section 6 system integration module (sim60) for more details. 2.1.14.2 vccclk and gndclk. these pins provide power and ground to the clock out- put pins (clko1 and clko2). they should be bypassed to each other with a 0.1- m f capac- itor. see the system clock generation description in section 6 system integration module (sim60) for more detail. 2.1.14.3 gnds1 and gnds2. these two pins are special ground pins that, if used prop- erly, allow more aggressive timing to be provided on certain system bus pins. these pins include as , casx, and ipipe . section 10 electrical characteristics already shows the aggressive timing; the user does not need to modify any values in the section. gnds1 and gnds2 should be connected to a quiet ground source or to a low-noise ground plane. 2.1.14.4 vcc and gnd. these pins are the rest of the power and ground connections for the quicc. 2.1.14.5 nc4?c1. these four pins should not be connected on the quicc package. they are reserved for future enhancements. table 2-6. initial configuration configuration pins config2/ freeze config1/ bclro config0/ rmc result 0 0 0 slave mode; global cs 8-bit size; mbar at $003ff00. 001 slave mode; global cs 32-bit size; mbar at $003ff00; not mc68040 com- panion mode; br output, bg input. 0 1 0 slave mode; global cs 16-bit size; mbar at $003ff00. 011 mc68040 companion mode; global cs 32-bit size; mbar at $003ff00; br input, bg output. 1 0 0 cpu enabled; global cs 32-bit size; mbar at $003ff00. 1 0 1 cpu enabled; global cs 16-bit size; mbar at $003ff00. 1 1 0 slave mode; global cs disabled; mbar at $003ff04. 1 1 1 cpu enabled; global cs 8-bit size; mbar at $003ff00. (default)
signal descriptions 2-14 mc68360 user? manual motorola 2.2 system bus signal index in slave mode the config2?onfig0 pins are used to cause the quicc to enter the slave mode. the signal name, mnemonic, and a brief functional description are presented in table 2-7. the rest of the quicc pins maintain their functionality in slave mode. see section 4 bus oper- ation for details. additionally, the quicc provides special support for the mc68ec040 bus (or other mc68040 family members) during slave mode. the mc68ec040 signals are marked in boldface in the table. for more information on mc68ec040 bus operation, see m68040um/ ad, m68040 user's manual . the quicc mc68ec040 support is described in section 4 bus operation and section 6 system integration module (sim60). table 2-7. system bus signal index (slave mode) master mode mnemonic slave mode signal name slave mode mnemonic slave mode function fc2?c0 function codes/ transfer modifier fc2?c0/ tm2?m0 identifies the processor state and the address space of the cur- rent bus cycle (i/o), or indicates the mc68ec040 supplement information about the access (i) . fc3 function code/ transfer type fc3/ tt0 identifies the dma address space of the current bus cycle (i/o), or indicates the mc68ec040 general transfer type: normal, move16, alternate logical function code, and acknowledge (i). ds data strobe/ transfer type ds / tt1 data strobe (i/o), or indicates the mc68ec040 general trans- fer type: normal, move16, alternate logical function code, and acknowledge (i). dsack1 data and size ac- knowledge/ transfer acknowl- edge dsack1 / ta provides asynchronous data transfers and dynamic bus sizing; for the mc68ec040, asserted to acknowledge bus transfer. (both are open-drain i/o but driven high before three-stated.) dsack0 data and size ac- knowledge/ transfer burst in- hibit dsack0 / tbi provides asynchronous data transfers and dynamic bus sizing; for the mc68ec040, indicates that a slave cannot handle a line burst access . (both are open-drain i/o but driven high be- fore three-stated.) berr bus error/ transfer error acknowledge berr / tea berr indicates an erroneous bus operation is being attempted by the quicc (open-drain i/o); tea indicates the same for the mc68ec040 (open-drain i/o) tris transfer start ts indicates the beginning of an mc68040 bus transfer. (i) ipipe0 /ifetch burst address badd3?add2 address lines 2,3 generated by the quicc on behalf of the mc68ec040, for mc68ec040 burst memory cycles. (o) br bus request br br asserted by the quicc to request bus mastership (o.d. o), or bus request input from the mc68040. (i) bg bus grant bg bg asserted by external logic to grant bus mastership to the quicc (i), or bus grant output to the mc68040. (o) bgack bus grant acknowl- edge bus busy bgack bb indicates that an external device or the quicc has assumed bus mastership. (open-drain i/o but driven high before three- stated). rmc /config0 040 lock cycle/ configuration 0 lock / config0 an mc68040 lock signal input to prevent the quicc from obtaining the system bus during locked cycles (i) , and the initial quicc configuration select (i). bkpt breakpoint out bkpto signals a hardware breakpoint to the external cpu. (o) freeze/ config2 freeze/initial configuration pin 2 mbare / config2 provides an mbar access enable (i), or the initial quicc con- figuration select. (i) irq1 ,4 ,6 interrupt request/ interrupt outputs irq6 ,4 ,1 / iout2 ?out0/ irqout provides an interrupt request to the quicc interrupt controller (i), or interrupt output signals (o) (either rqout as a single re- quest or iout2 ?out0 encoded).
signal descriptions motorola mc68360 user? manual 2-15 2.3 on-chip peripherals signal index the input and output system signals for the quicc peripherals are listed in table 2-8. the signal name, mnemonic, and a brief functional description are presented. for more detail on each signal, refer to the specific module section. the peripherals pins are divided into three ports: a, b, and c. port a has 16 pins, port b has 18 pins, and port c has 12 pins. all the following signals are multiplexed with either port a, b, or c. all pins may be inputs or outputs; in addition, some pins may be configured to be open-drain. see 7.14 parallel i/o ports for further details. table 2-7. system bus signal index (slave mode) (continued) master mode mnemonic slave mode signal name slave mode mnemonic slave mode function prty0 parity 0/interrupt out- put 2 prty0/iout2 parity signals for d31?24 writes/reads from/to external mem- ory bank (i/o), or interrupt output 2 signal (o). prty1 parity 1/interrupt out- put 1 prty1/iout1 parity signals for d23?16 writes/reads from/to external mem- ory bank (i/o) or interrupt output 1 signal. (o) prty2 parity 2/ interrupt output 0/ request output prty2/iout0 / rqout parity signals for d15?8 writes/reads from/to external memory bank (i/o), or interrupt output 0 signal (o), or rqout as a sin- gle interrupt request output (o). avec /iack5 autovector output aveco signal output to the external processor to generate an internal vector number during an interrupt acknowledge cycle. (three- stated o) ipipe1 / ras1dd bus clear input/ row address select 1 double-drive bclri / ras1dd signals that an external device requests the quicc to release the external bus (i), or row address select 1 double-drive (o). table 2-8. peripherals signal index group signal name mnemonic function scc receive data rxd4?xd1 serial receive data input to the sccs. (i) transmit data txd4?xd1 serial transmit data output from the sccs. (o) request to send rts4 ?ts1 request to send outputs indicate that the scc is ready to transmit data. (o) clear to send cts4 ?ts1 clear to send inputs indicate to the scc that data transmission may begin. (i) carrier detect cd4 ?d1 carrier detect inputs indicate that the scc should begin reception of data. (i) receive start rstrt1 this output from scc1 identifies the start of a receive frame. can be used by an ethernet cam to perform address matching. (o) receive reject rrjct1 this input to scc1 allows a cam to reject the current ethernet frame after it determines the frame address did not match. (i) clocks clk8?lk1 input clocks to the sccs, smcs, si, and the baud rate generators. (i) idma dma request dreq2 ?req1 a request (input) to an idma channel to start an idma transfer. (i) dma acknowledge dack2 ?ack1 an acknowledgement (output) by the idma that an idma transfer is in progress. (o) dma done done2 ?one1 a bidirectional signal that indicates the last idma transfer in a block of data. (i/o) timer timer gate tgate2 ?gate1 an input to a timer that enables/disables the counting function. (i) timer input tin4?in1 time reference input to the timer that allows it to function as a counter. (i)
signal descriptions 2-16 mc68360 user? manual motorola table 2-8. peripherals signal index (continued) group signal name mnemonic function timer output tout4 ?out1 output waveform (pulse or toggle) from the timer as a result of a ref- erence value being reached. (o) spi spi master-in slave- out spimiso serial data input to the spi master (i); serial data output from an spi slave (o). spi master-out slave-in spimosi serial data output from the spi master (o).; serial data input to an spi slave (i). spi clock spiclk output clock from the spi master (o); input clock to the spi slave (i). spi select spisel spi slave select input. (i) smc smc receive data smrxd2?mrxd1 serial data input to the smcs. (i) smc transmit data smtxd2?mtxd1 serial data output from the smcs. (o) smc sync smsyn2?msyn1 smc synchronization signal. (i) si si receive data l1rxda, l1rxdb serial input to the time division multiplexed (tdm) channel a or channel b. si transmit data l1txda, l1txdb serial output from the tdm channel a or channel b. si receive clock l1rclka, l1rclkb input receive clock to tdm channel a or channel b. si transmit clock l1tclka, l1tclkb input transmit clock to tdm channel a or channel b. si transmit sync signals l1tsynca, l1tsyncb input transmit data sync signal to the tdm channel a or channel b. si receive sync signals l1rsynca, l1rsyncb input receive data sync signal to tdm channel a or channel b. idl interface re- quest l1rqa, l1rqb idl interface request to transmit on the d channel. output from the si. si output clock l1clkoa, l1clkob output serial data rate clock. can output a data rate clock when the input clock is 2x the data rate. si data strobes l1st4?l1st1 serial data strobe outputs can be used to gate clocks to external de- vices that do not have a built-in time slot assigner (tsa). brg baud rate genera- tor out 4? brgo4?rgo1 baud rate generator output clock allows baud rate generator to be used externally. brg input clock clk2, clk6 baud rate generator input clock from which brg will derive the baud rates. pip port b 15? pb15?b0 pip data i/o pins strobe out strbo this input causes the pip output data to be placed on the pip data pins. strobe in strbi this input causes data on the pip data pins to be latched by the pip as input data. sdma sdma acknowl- edge 2? sdack2 ?dack1 sdma output signals used in risc receiver to mark fields in the ethernet receive frame.
signal descriptions 2-17 mc68360 user? manual motorola
signal descriptions 2-18 mc68360 user? manual motorola
motorola mc68360 user? manual 3-1 section 3 quicc memory map the following tables present a programmer? model (register map) of all registers in the quicc. for more information about a particular register, refer to the description for the mod- ule or sub-module indicated in the right column. the address column indicates the offset of the register from the address stored in the module base address register (mbar). this reg- ister in the sim block controls the location of all internal memory/registers as well as their supervisor/user access space (see section 6 system integration module (sim60)). bold let- ters mark registers that are restricted to supervisor access. other registers are programma- ble to exist in either supervisor or user space. registers that are reset only by hard reset are marked with an h in the reset value column. all of the registers are memory-mapped. all internal memory and registers occupy a single 8-kbyte memory block that is relocatable along 8-kbyte boundaries. the location is fixed by writing the desired base address of the 8-kbyte memory block to the mbar using the moves instruction. the mbar is the only exception since it resides at a fixed location in $03ff00. the 8-kbyte block is divided into two 4-kbyte sections. the ram occupies the first section; the internal registers occupy the second section. the location of the quicc registers is shown in figure 3-1. thi d t t d ith f m k 4 0 4
quicc memory map 3-2 mc68360 user? manual motorola figure 3-1. quicc memory map 3.1 dual-port ram memory map the internal 2816-byte (2560-byte on rev a and b mask) dual-port ram is partitioned to 1792 bytes (1536 bytes on rev a and b mask) of system ram, 256-byte microcode scratch area, and 768 bytes of parameter ram (see table 3-1). its base address, called dual-port ram base (dprbase), is the address pointed to by the mbar. note rev a mask is c63t, rev b mask are c69t, and f35g the system ram may be used for microcode program area, data area, and buffer descrip- tors (bds). it may be partitioned in several ways, allowing programmable partition sizes to fit the system requirements. this is described in section 7 communication processor mod- ule (cpm). internal registers 4kb 4kb mbar (sim) regb (register base) = dprbase + 4k dprbase (dual-port ram base) dual-port ram
quicc memory map motorola mc68360 user? manual 3-3 the parameter ram contains the protocol-specific parameters. for detailed information about the use of the buffer descriptors and protocol parameters in a specific protocol, see section 7 communication processor module (cpm). 3.2 cpm sub-module base addresses within the four parameter ram pages are the base addresses for the cpm sub-modules such as the sccs, smcs, etc. the base addresses for the sub-modules are shown in table 3-2. see the particular sub-module description within section 7 communication processor module (cpm) for further information. table 3-1. dual-port ram map address size block description dprbase + 0 dprbase + 3ff 1024 bytes dual-port ram user data / bds / microcode program dprbase + 400 dprbase + 5ff 512 bytes dual-port ram user data / bds dprbase + 600 dprbase + 6ff 256 bytes dual-port ram user data / bds / microcode scratch dprbase + 700 dprbase + bff 256 bytes dual-port ram user data / bds dprbase + c00 dprbase + cbf 192 bytes dual-port ram parameter ram page 1 dprbase + cc0 dprbase + cff reserved reserved dprbase + d00 dprbase + dbf 192 bytes dual-port ram parameter ram page 2 dprbase + dc0 dprbase + dff reserved reserved dprbase + e00 dprbase + ebf 192 bytes dual-port ram parameter ram page 3 dprbase + ec0 dprbase + eff reserved reserved dprbase + f00 dprbase + fbf 192 bytes dual-port ram parameter ram page 4 dprbase + fc0 dprbase + fff reserved reserved table 3-2. cpm sub-module base addresses parameter ram page sub-module base address 1 scc1 base dprbase + $c00 1 misc base dprbase + $cb0 2 scc2 base dprbase + $d00 2 spi base dprbase + $d80 2 timer base dprbase + $db0 3 scc3 base dprbase + $e00 3 idma1 base dprbase + $e70
quicc memory map 3-4 mc68360 user? manual motorola 3.3 internal registers memory map in addition to the internal dual-port ram, there are a number of internal registers to support the functions of the various cpu32+ core peripherals. the internal registers (see table 3-3 and table 3-4) are memory-mapped registers offset from the register base (regbase) pointer. regbase (abbreviated regb) = dprbase + 4k. all registers are located on the internal imb. notes all registers that are underlined in the following tables are spe- cial registers called event registers. in these registers, bits are set by the quicc and cleared by the user. to clear a bit, the user must write a one to that bit. for example, to clear bit 2 in scce1, the move.b #$04,scce1 instruction may be used. do not use read-modify-write instructions (such as bset, bclr, and, or, etc.) with these registers, or all bits in that register will inadvertently be cleared. see the individual register descrip- tions for more information. all undefined and reserved bits within registers and parameter ram values written by the user should be written with zero to al- low for future enhancements to the device. bold letters mark registers that are restricted to supervisor ac- cess. 3.3.1 sim registers memory map table 3-3 lists the sim registers memory map. 3 smc1 base dprbase + $e80 4 scc4 base dprbase + $f00 4 idma2 base dprbase + $f70 4 smc2 base dprbase + $f80 table 3-2. cpm sub-module base addresses
quicc memory map motorola mc68360 user? manual 3-5 table 3-3. quicc sim registers memory map address name width description reset value block regb + 0000 mcr 32 module configuration register 0000 7cff h sim regb + 0004 32 reserved regb + 0008 avr 8 autovector register 00 h regb + 0009 rsr 8 reset status register h/s regb + 000a 16 reserved regb + 000c clkocr 8 clko control register f(modck1) h regb + 000d reserved regb + 0010 pllcr 16 pll control register f(modck1?) h regb + 0012 16 reserved regb + 0014 cdvcr 16 clock divider control register 0000 h regb + 0016 pepar 16 port e pin assignment register 0000 h regb + 0018 to regb + 0021 reserved regb + 0022 sypcr 8 system protection control f(modck1?) h regb + 0023 swiv 8 software interrupt vector 0f h regb + 0024 16 reserved regb + 0026 picr 16 periodic interrupt control register 000f h regb + 0028 16 reserved regb + 002a pitr 16 periodic interrupt timing register 0000/0300 h regb + 002c 24 reserved regb + 002f swsr 8 software service register 00 h regb + 0030 bkar 32 breakpoint address register xxxx regb + 0034 bkcr 32 breakpoint control register 0000 0000 h regb + 0038 to regb + 003f reserved regb + 0040 gmr 32 global memory register 0000 1200 h memc regb + 0044 mstat 16 memory controller status register 0000 h regb + 0046 to regb + 004f reserved regb + 0050 br0 32 base register 0 0000 0051 h regb + 0054 or0 32 option register 0 f000 0000 h regb + 0058 to regb + 005f reserved regb + 0060 br1 32 base register 1 0000 0050 h regb + 0064 or1 32 option register 1 f000 000x h regb + 0068 to regb +006f reserved regb + 0070 br2 32 base register 2 0000 0050 h regb + 0074 or2 32 option register 2 f000 000x h
quicc memory map 3-6 mc68360 user? manual motorola 3.3.2 cpm registers memory map table 3-4 lists the cpm registers memory map. regb + 0078 to regb + 007f reserved regb + 0080 br3 32 base register 3 0000 0050 h regb + 0084 or3 32 option register 3 f000 000x h regb + 0088 to regb + 008f reserved regb + 0090 br4 32 base address register 4 0000 0050 h regb + 0094 or4 32 option register 4 f000 000x h regb + 0098 to regb + 009f reserved regb + 00a0 br5 32 base address register 5 0000 0050 h regb + 00a4 or5 32 option register 5 f000 000x h regb + 00a8 to regb + 00af reserved regb + 00b0 br6 32 base address register 6 0000 0050 h regb + 00b4 or6 32 option register 6 f000 000x h regb + 00b8 to regb + 00bf reserved regb + 00c0 br7 32 base address register 7 0000 0050 h regb + 00c4 or7 32 option register 7 f000 000x h regb + 00c8 to regb + 00ef reserved regb + 00f0 to regb + 00ff reserved table 3-4. quicc cpm registers memory map address name width description reset value block regb + 400 to regb + 4ff reserved regb + 500 iccr 16 channel configuration register 0000 h idma1 regb + 502 16 reserved regb + 504 cmr1 16 idma1 mode register 0000 regb + 506 16 reserved regb + 508 sapr1 32 idma1 source address pointer 0000 0000 regb + 50c dapr1 32 idma1 destination address pointer 0000 0000 regb + 510 bcr1 32 idma1 byte count register 0000 0000 regb + 514 fcr1 8 idma1 function code register 00 table 3-3. quicc sim registers memory map
quicc memory map motorola mc68360 user? manual 3-7 regb + 515 8 reserved regb + 516 cmar1 8 channel mask register 00 regb + 517 8 reserved regb + 518 csr1 8 idma1 channel status register 00 regb + 519 24 reserved regb + 51c sdsr 8 sdma status register 00 sdma regb + 51d 8 reserved regb + 51e sdcr 16 sdma configuration register 0000 h regb + 520 sdar 32 sdma address register xxxx xxxx regb + 524 16 reserved idma2 regb + 526 cmr2 16 idma2 mode register 0000 regb + 528 sapr2 32 idma2 source address pointer 0000 0000 regb + 52c dapr2 32 idma2 destination address pointer 0000 0000 regb + 530 bcr2 32 idma2 byte count register 0000 0000 regb + 534 fcr2 8 idma2 function code register 00 regb + 535 8 reserved regb + 536 cmar2 8 channel mask register 00 regb + 537 8 reserved regb + 538 csr2 8 idma2 channel status register 00 regb + 539 to regb + 53f reserved regb + 540 cicr 24 cp interrupt configuration register xx00 0000 h cpic regb + 544 cipr 32 cp interrupt pending register 0000 0000 regb + 548 cimr 32 cp interrupt mask register 0000 0000 regb + 54c cisr 32 cp in-service register 0000 0000 regb + 550 padir 16 port a data direction register 0000 h parallel i/o regb + 552 papar 16 port a pin assignment register 0000 h regb + 554 paodr 16 port a open drain register 0000 h regb + 556 padat 16 port a data register xxxx regb + 558 to regb + 55f reserved regb + 560 pcdir 16 port c data direction register 0000 h regb + 562 pcpar 16 port c pin assignment register 0000 h regb + 564 pcso 16 port c special options 0000 h regb + 566 pcdat 16 port c data register xxxx regb + 568 pcint 16 port c interrupt control register 0000 h regb + 56a to regb + 57f reserved regb + 580 tgcr 16 timer global configuration register 0000 h timer table 3-4. quicc cpm registers memory map
quicc memory map 3-8 mc68360 user? manual motorola regb + 582 to regb + 58f reserved regb + 590 tmr1 16 timer1 mode register 0000 regb + 592 tmr2 16 timer2 mode register 0000 regb + 594 trr1 16 timer1 reference register ffff regb + 596 trr2 16 timer2 reference register ffff regb + 598 tcr1 16 timer1 capture register 0000 regb + 59a tcr2 16 timer2 capture register 0000 regb + 59c tcn1 16 timer1 counter 0000 regb + 59e tcn2 16 timer2 counter 0000 regb + 5a0 tmr3 16 timer3 mode register 0000 regb + 5a2 tmr4 16 timer4 mode register 0000 regb + 5a4 trr3 16 timer3 reference register ffff regb + 5a6 trr4 16 timer4 reference register ffff regb + 5a8 tcr3 16 timer3 capture register 0000 regb + 5aa tcr4 16 timer4 capture register 0000 regb + 5ac tcn3 16 timer3 counter 0000 regb + 5ae tcn4 16 timer4 counter 0000 regb + 5b0 ter1 16 timer1 event register 0000 regb + 5b2 ter2 16 timer2 event register 0000 regb + 5b4 ter3 16 timer3 event register 0000 regb + 5b6 ter4 16 timer4 event register 0000 regb + 5b8 to regb + 5bf reserved regb + 5co cr 16 command register 0000 cp regb + 5c4 rccr 16 risc configuration register 0000 h regb + 5c6 to regb + 5d5 reserved regb + 5d6 rter 16 risc timers event register 0000 regb + 5da rtmr 16 risc timers mask register 0000 regb + 5dc to regb + 5ef reserved regb + 5f0 brgc1 24 brg1 configuration register xx00 0000 h brg regb + 5f4 brgc2 24 brg2 configuration register xx00 0000 h regb + 5f8 brgc3 24 brg3 configuration register xx00 0000 h regb + 5fc brgc4 24 brg4 configuration register xx00 0000 h regb + 600 gsmr_l1 32 scc1 general mode register 0000 0000 scc1 regb + 604 gsmr_h1 32 scc1 general mode register 0000 0000 regb + 608 psmr1 16 scc1 protocol-specific mode register 0000 regb + 60c todr1 16 scc1 transmit on demand 0000 table 3-4. quicc cpm registers memory map
quicc memory map motorola mc68360 user? manual 3-9 regb + 60e dsr1 16 scc1 data sync. register 7e7e regb + 610 scce1 16 scc1 event register 0000 regb + 614 sccm1 16 scc1 mask register 0000 regb + 617 sccs1 8 scc1 status register 00 regb + 618 to regb + 61f reserved regb + 620 gsmr_l2 32 scc2 general mode register 0000 0000 scc2 regb + 624 gsmr_h2 32 scc2 general mode register 0000 0000 regb + 628 psmr2 16 scc2 protocol-specific mode register 0000 regb + 62c todr2 16 scc2 transmit on demand 0000 regb + 62e dsr2 16 scc2 data sync. register 7e7e regb + 630 scce2 16 scc2 event register 0000 regb + 634 sccm2 16 scc2 mask register 0000 regb + 637 sccs2 8 scc2 status register 00 regb + 638 to regb + 63f reserved regb + 640 gsmr_l3 32 scc3 general mode register 0000 0000 scc3 regb + 644 gsmr_h3 32 scc3 general mode register 0000 0000 regb + 648 psmr3 16 scc3 protocol-specific mode register 0000 regb + 64c todr3 16 scc3 transmit on demand 0000 regb + 64e dsr3 16 scc3 data sync. register 7e7e regb + 650 scce3 16 scc3 event register 0000 regb + 654 sccm3 16 scc3 mask register 0000 regb + 657 sccs3 8 scc3 status register 00 regb + 658 to regb + 65f reserved regb + 660 gsmr_l4 32 scc4 general mode register 0000 0000 scc4 regb + 664 gsmr_h4 32 scc4 general mode register 0000 0000 regb + 668 psmr4 16 scc4 protocol-specific mode register 0000 regb + 66c todr4 16 scc4 transmit on demand 0000 regb + 66e dsr4 16 scc4 data sync. register 7e7e regb + 670 scce4 16 scc4 event register 0000 regb + 674 sccm4 16 scc4 mask register 0000 regb + 677 sccs4 8 scc4 status register 00 regb + 678 to regb + 681 reserved regb + 682 smcmr1 16 smc1 mode register 0000 smc1 regb + 686 smce1 8 smc1 event register 00 regb + 68a smcm1 8 smc1 mask register 00 regb + 68c reserved table 3-4. quicc cpm registers memory map
quicc memory map 3-10 mc68360 user? manual motorola notes: 1.reset value ?ld. 2.h=effected only upon reseth assertion 3.s=effected only upon resets assertion 4.blank ?ld = effected by both reseth or resets assertion. regb + 692 smcmr2 16 smc2 mode register 0000 smc2 regb + 696 smce2 8 smc2 or pip event register 00 regb + 69a smcm2 8 smc2 mask register 00 regb + 69c reserved regb + 6a0 spmode 16 spi mode register 0000 h spi regb + 6a6 spie 8 spi event register 00 regb + 6aa spim 8 spi mask register 00 regb + 6ad spcom 8 spi command register 00 regb + 6b2 pipc 16 pip configuration register 0000 h pip regb + 6b6 ptpr 16 pip timing parameters register 0000 regb + 6b8 pbdir 18 port b data direction register xxx0 0000 h regb + 6bc pbpar 18 port b pin assignment register xxx0 0000 h regb + 6c2 pbodr 16 port b open drain register 0000 h regb + 6c4 pbdat 18 port b data register xxxx xxxx regb + 6c8 to regb + 6df reserved regb + 6e0 simode 32 si mode register 0000 0000 h si regb + 6e4 sigmr 8 si global mode register 00 h regb + 6e6 sistr 8 si status register 00 h regb + 6e7 sicmr 8 si command register 00 regb + 6e8 32 reserved regb+ 6ec sicr 32 si clock route 0000 0000 h regb + 6f2 sirp 32 si ram pointers 0000 0000 regb + 6f6 to regb + 6ff res reserved regb + 700 to regb + 7ff siram 256 bytes si routing ram xxxx table 3-4. quicc cpm registers memory map
motorola mc68360 user? manual 4-1 section 4 bus operation this section provides a functional description of the system bus, the signals that control it, and the bus cycles provided for data transfer operations. it also describes the error and halt conditions, bus arbitration, and reset operation. operation of the external bus is the same whether the quicc or an external device is the bus master; the names and descriptions of bus cycles are from the viewpoint of the bus master. for exact timing specifications, refer to section 10 electrical characteristics. note the bus operation of the quicc is very similar to the bus oper- ation of the mc68030 and the mc68340. much of the text and figures of the bus operation of those devices is common to this section. the quicc also supports the mc68ec040 (or other m68040 family members) as an exter- nal bus master. the mc68ec040 can access quicc registers and use quicc peripherals. the quicc has a glueless mc68ec040 interface and special logic for acting as the mc68ec040 memory controller, interrupt controller, and the provider of system protection logic. the mc68ec040 bus operation is described in the m68040 user manual . when the quicc is the bus master of an m68040 system, its bus operation remains the same when it is the only bus master in the system. see 4.6.7 internal accesses for a description and timing diagram of the mc68ec040 internal read/write cycles (i.e., mc68ec040 reading/writ- ing the quicc) and interrupt acknowledge cycles. see 6.11 general-purpose chip-select overview (sram banks) and 6.12 dram controller overview (dram banks) for more information on the timing diagrams of mc68ec040 dram and sram accesses. the quicc architecture supports byte, word, and long-word operands allowing access to 8-, 16-, and 32-bit data ports through the use of asynchronous cycles controlled by the size outputs (siz1, siz0) and data size acknowledge inputs (dsack1 , dsack0 ). the quicc allows byte, word, and long-word operands to be located in memory on any byte boundary. for a misaligned transfer, more than one bus cycle may be required to complete the transfer, regardless of port size. for a port less than 32 bits wide, multiple bus cycles may be required for an operand transfer due to either misalignment or a port width smaller than the operand size. instruction words and their associated extension words must be aligned on word boundaries. the user should be aware that misalignment of word or long- word operands can cause the cpu32+ to perform multiple bus cycles for operand transfers; therefore, processor performance is optimized if word and long-word memory operands are thi d t t d ith f m k 4 0 4
bus operation 4-2 mc68360 user? manual motorola aligned on word or long-word boundaries, respectively. the quicc idmas, when used, reduce the misalignment overhead to a minimum. 4.1 bus transfer signals the bus transfers information between the quicc and external memory or a peripheral device. external devices can accept or provide 8, 16, or 32 bits in parallel and must follow the handshake protocol described in this section. the maximum number of bits accepted or provided during a bus transfer is defined as the port width. the quicc contains an address bus that specifies the address for the transfer and a data bus that transfers the data. control signals indicate the beginning and type of the cycle as well as the address space and size of the transfer. the selected device then controls the length of the cycle with the signal(s) used to terminate the cycle. strobe signals, one for the address bus and another for the data bus, indicate the validity of the address and provide timing information for the data. both asynchronous and synchronous operation is possible for any port width. in asynchro- nous operation, the bus and control input signals are internally synchronized to the quicc clock, introducing a delay. this delay is the time required for the quicc to sample an input signal, synchronize the input to the internal clocks, and determine whether it is high or low. in synchronous mode, the bus and control input signals must be timed to setup and hold times. since no synchronization is needed, bus cycles can be completed in three clock cycles in this mode. additionally, using the fast-termination option of the chip-select signals, two-clock operation is possible. furthermore, for all inputs, the quicc latches the level of the input during a sample window around the falling edge of the clock signal. this window is illustrated in figure 4-1, where t su and t h are the input setup and hold times, respectively. to ensure that an input signal is rec- ognized on a specific falling edge of the clock, that input must be stable during the sample window. if an input makes a transition during the window time period, the level recognized by the quicc is not predictable; however, the quicc always resolves the latched level to either a logic high or low before using it. in addition to meeting input setup and hold times for deterministic operation, all input signals must obey the protocols described in this sec- tion. figure 4-1. input sample window sample window t su t h clk ext
bus operation motorola mc68360 user? manual 4-3 4.1.1 bus control signals the quicc initiates a bus cycle by driving the address, size, function code, and read/write outputs. at the beginning of a bus cycle, siz1 and siz0 are driven with the fc signals. siz1 and siz0 indicate the number of bytes remaining to be transferred during an operand cycle (consisting of one or more bus cycles). table 4-3 lists the encoding of siz1 and siz0. these signals are valid while as is asserted. the r/w signal determines the direction of the transfer during a bus cycle. driven at the beginning of a bus cycle, r/w is valid while as is asserted. r/w only transitions when a write cycle is preceded by a read cycle or vice versa. the signal may remain low for consecutive write cycles. the rmc signal is asserted at the beginning of the first bus cycle of a read-modify-write operation and remains asserted until completion of the final bus cycle of the operation. 4.1.2 function codes (fc3?c0) the fcx signals are outputs that indicate one of 16 address spaces to which the address applies. fifteen of these spaces are designated as either a normal or dma cycle, user or supervisor, and program or data spaces. one other address space is designated as cpu space to allow the cpu32+ to acquire specific control information not normally associated with read or write bus cycles. the fcx signals are valid while as is asserted. function codes (see table 4-1) can be considered as extensions of the 32-bit address that can provide up to eight different 4-gbyte address spaces. function codes are automatically generated by the cpu32+ to select address spaces for data and program at both user and supervisor privilege levels, and a cpu address space for processor functions. user pro- grams access only their own program and data areas to increase protection of system integ- rity and can be restricted from accessing other information. the s-bit in the cpu32+ status register is set for supervisor accesses and cleared for user accesses to provide differentia- tion. refer to 4.4 cpu space cycles for more information. table 4-1. address space encoding function code bits 3210 address spaces 0000 reserved (motorola) 0001 user data space 0010 user program space 0011 reserved (user) 0100 reserved (motorola) 0101 supervisor data space 0110 supervisor program space 0111 supervisor cpu space 1 x x x dma space
bus operation 4-4 mc68360 user? manual motorola 4.1.3 address bus (a31?0) the address bus signals are outputs that define the address of the byte (or the most signif- icant byte) to be transferred during a bus cycle. the quicc places the address on the bus at the beginning of a bus cycle. the address is valid while as is asserted. 4.1.4 address strobe (as ) as is an output timing signal that indicates the validity of an address on the address bus and of many control signals. as is asserted approximately one-half clock cycle after the begin- ning of a bus cycle. 4.1.5 data bus (d31-d0) the data bus is a bidirectional, nonmultiplexed, parallel bus that contains the data being transferred to or from the quicc. a read or write operation may transfer 8, 16, 24, or 32 bits of data (one, two, three, or four bytes) in one bus cycle. during a read cycle, the data is latched by the quicc on the last falling edge of the clock for that bus cycle. for a write cycle, all 32 bits of the data bus are driven, regardless of the port width or operand size. the quicc places the data on the data bus approximately one-half clock cycle after as is asserted in a write cycle. 4.1.6 data strobe (ds ) ds is an output timing signal that applies to the data bus. for a read cycle, the quicc asserts ds and as simultaneously to signal the external device to place data on the bus. for a write cycle, ds signals to the external device that the data to be written is valid. the quicc asserts ds approximately one clock cycle after the assertion of as during a write cycle. 4.1.7 output enable (oe ) oe is an output timing signal that applies to the data bus. on a read cycle, the quicc asserts oe to signal the external device to place data on the bus. oe is asserted during read cycles with timing similar to as . oe is not shown in the diagrams in this section. use as timing instead during read cycles. 4.1.8 byte write enable (we0 , we1 , we2 , we3 ) the upper upper write enable (we0 ) indicates that the upper eight bits of the data bus (d31 d24) contain valid data during a write cycle. the upper middle write enable (we1 ) indicates that the upper middle eight bits of the data bus (d23?16) contain valid data during a write cycle. the lower middle write enable (we2 ) indicates that the lower middle eight bits of the data bus (d15?8) contain valid data during a write cycle. the lower write enable (we3 ) indicates that the lower eight bits of the data bus contain valid data during a write cycle.
bus operation motorola mc68360 user? manual 4-5 the equations of the byte write enables for 32-bit port (16bm = 1) are as follows: we0 = r/w + as + a0 + a1 we1 = r/w + as + not {(a1 * siz0 ) + (a0 * a1 ) + (a1 * siz1)} we2 = r/w + as + not {(a0 * a1) + (a1 * siz0 * siz1 ) + (a1 * siz0 * siz1) + (a0 * a1 * siz0 )} we3 = r/w + as + not {(a0 * siz0 * siz1) + (siz0 * siz1 ) + (a0 * a1) + (a1 * siz1)} these signals have the same timing as as . the equations are valid only for a 32-bit port. the equations of the byte write enables for 16-bit port (b16m = 0) are as follows: we0 = r/w + as + a0 we1 = r/w + as + (a0 * siz0 * siz1 ) these signals have the same timing as as . the equations are valid only for a 16-bit port. wex signals are not shown in the diagrams in this section. use as timing instead during write cycles. the particular wex signals that are active in a given bus cycle depend on which bytes are being written. note note that the we signals are not affected by dynamic bus sizing. external assertion of dsackx will have no effect on which wex signal gets asserted. when 16-bit mode is selected and bit 7 of pepar is set, we2 and we3 are used as address lines a29 and a28 respectively. 4.1.9 bus cycle termination signals the following signals can terminate a bus cycle. 4.1.9.1 data transfer and size acknowledge (dsack1 and dsack0 ). dur- ing bus cycles, external devices assert dsack1 and/or dsack0 as part of the bus protocol. during a read cycle, this signals the quicc to terminate the bus cycle and to latch the data. during a write cycle, this indicates that the external device has successfully stored the data and that the cycle may terminate. these signals also indicate to the quicc the size of the port for the bus cycle just completed (see table 4-3). refer to 4.3.1 read cycle for timing relationships of dsack1 and dsack0 . additionally, the system integration module (sim60) can be programmed to internally gen- erate dsack1 and dsack0 for external accesses, eliminating logic required to generate these signals. the sim60 can alternatively be programmed to generate a fast termination, providing a two-cycle external access. refer to 4.2.6 fast termination cycles for additional information on these cycles. 4.1.9.2 bus error (berr ). this signal is also a bus cycle termination indicator and can be used in the absence of dsackx to indicate a bus error condition. berr can also be asserted in conjunction with dsackx to indicate a bus error condition, provided it meets the
bus operation 4-6 mc68360 user? manual motorola appropriate timing described in this section and in section 10 electrical characteristics. additionally, berr and halt can be asserted together to indicate a retry termination. refer to 4.5 bus exception control cycles for additional information on the use of these signals. see the memory controller description in section 6 system integration module (sim60) for precautions about asserting berr externally too early during dram and sram cycles con- trolled by the memory controller. the internal bus monitor can be used to generate the berr signal for internal and external transfers in all the following descriptions. 4.1.9.3 autovector (avec ). this signal can be used to terminate interrupt acknowl- edge cycles, indicating that the quicc should internally generate a vector (autovector) number to locate an interrupt handler routine. avec can be generated either externally or internally by the sim60 (refer to section 6 system integration module (sim60) for additional information). avec is ignored during all other bus cycles. 4.2 data transfer mechanism the quicc supports byte, word, and long-word operands, allowing access to 8-,16-, and 32-bit data ports through the use of asynchronous cycles controlled by dsack1 and dsack0 . the quicc also supports byte, word, and long-word operands, allowing access to 8-, 16, and 32-bit data ports through the use of synchronous cycles controlled by the fast- termination capability of the sim60. 4.2.1 dynamic bus sizing the quicc dynamically interprets the port size of the addressed device during each bus cycle, allowing operand transfers to or from 8-, 16-, and 32-bit ports. during an operand transfer cycle, the slave device signals its port size (byte, word, or long word) and indicates completion of the bus cycle to the quicc through the use of the dsackx inputs. refer to table 4-2 for dsackx encoding. for example, if the quicc is executing an instruction that reads a long-word operand from a long-word aligned address, it attempts to read 32 bits during the first bus cycle. (refer to 4.2.2 misaligned operands for the case of a word or byte address.) if the port responds that it is 32 bits wide, the quicc latches all 32 bits of data and continues with the next operation. if the port responds that it is 16 bits wide, the quicc latches the 16 bits of valid data and runs another bus cycle to obtain the other 16 bits. the operation for an 8-bit port is similar, but requires four read cycles. the addressed device uses the dsackx signals to indicate table 4-2. dsackx encoding dsack1 dsack0 result 1 1 insert wait states in current bus cycle 1 0 complete cycle?ata bus port size is 8 bits 0 1 complete cycle?ata bus port size is 16 bits 0 0 complete cycle?ata bus port size is 32 bits
bus operation motorola mc68360 user? manual 4-7 the port width. for instance, a 32-bit device always returns dsackx for a 32-bit port (regard- less of whether the bus cycle is a byte, word, or long-word operation). dynamic bus sizing requires that the portion of the data bus used for a transfer to or from a particular port size be fixed. a 32-bit port must reside on data bus bits 0?1, a 16-bit port must reside on data bus bits 16?2, and an 8-bit port must reside on data bus bits 24?1. this requirement minimizes the number of bus cycles needed to transfer data to 8- and 16- bit ports and ensures that the quicc correctly transfers valid data. the quicc always attempts to transfer the maximum amount of data on all bus cycles; for a long-word opera- tion, it always assumes that the port is 32 bit wide when beginning the bus cycle. the bytes of operands are designated as shown in figure 4-2. the most significant byte of a long-word operand is op0, and op3 is the least significant byte. the two bytes of a word- length operand are op2 (most significant) and op3. the single byte of a byte-length oper- and is op3. these designations are used in the figures and descriptions that follow. figure 4-2. internal operand representation figure 4-3 shows the required organization of data ports on the quicc bus for 8, 16, and 32-bit devices. the four bytes shown are connected through the internal data bus and data multiplexer to the external data bus. this path is the means through which the quicc sup- ports dynamic bus sizing and operand misalignment. refer to 4.2.2 misaligned operands for the definition of misaligned operand. the data multiplexer establishes the necessary connections for different combinations of address and data sizes. the multiplexer takes the four bytes of the 32-bit bus and routes them to their required posi- tions. for example, op0 can be routed to d24?31, as would be the normal case, or it can be routed to any other byte position to support a misaligned transfer. the same is true for any of the operand bytes. the positioning of bytes is determined by the size and address outputs. 0p0 0p1 0p2 0p3 31 0 15 0 0p2 0p3 70 long-word operand word operand byte operand 0p3
bus operation 4-8 mc68360 user? manual motorola figure 4-3. quicc interface to various port sizes the siz0 and siz1 outputs indicate the remaining number of bytes to be transferred during the current bus cycle (see table 4-3). the number of bytes transferred during a write or read bus cycle is equal to or less than the size indicated by the sizx outputs, depending on port width and operand alignment. for example, during the first bus cycle of a long-word transfer to a word port, the sizx outputs indicate that four bytes are to be transferred, although only two bytes are moved on that bus cycle. a0 and a1 also affect operation of the data multiplexer. during an operand transfer, a2-a31 indicate the long-word base address of that portion of the operand to be accessed; a0 and a1 indicate the byte offset from the base. table 4-4 lists the encoding of a0 and a1 and the corresponding byte offset from the long-word base. table 4-3. sizx encoding siz1 siz0 size 0 1 byte 1 0 word 1 1 3 bytes 0 0 long word 0123 routing and duplication byte 0 byte 2 byte 1 byte 3 16-bit port register multiplexer external data bus address xxxxxxxx0 xxxxxxxx0 2 increasing memory addresses d31?24 d23?16 d15?8 d7?0 byte 0 byte 1 byte 2 byte 3 byte 0 byte 1 byte 2 byte 3 8-bit port 2 3 1 xxxxxxxx0 external bus internal to the mc68360 32-bit port 0p0 0p1 0p2 0p3
bus operation motorola mc68360 user? manual 4-9 table 4-5 lists the bytes required on the data bus for read cycles. the entries shown as opx are portions of the requested operand that are read during that bus cycle and are defined by siz0, siz1, a0, and a1 for the bus cycle. bytes labeled x are ?on? cares?and are not required during that read cycle. table 4-6 lists the combinations of siz0, siz1, a0, and a1 and the corresponding pattern of the data transfer for write cycles from the internal multiplexer of the quicc to the external data bus. bytes labeled x are ?on't care. figure 4-4 shows the transfer of a long-word operand to a word port. in the first bus cycle, the quicc places the four operand bytes on the external bus. since the address is long- word aligned in this example, the multiplexer follows the pattern in the entry of table 4-6 cor- responding to siz0, siz1, a0, a1 = 0000. the port latches the data on bits d16?31 of the data bus, asserts dsack1 (dsack0 remains negated), and the quicc terminates the bus cycle. it then starts a new bus cycle with siz0, siz1, a0, a1 = 1010 to transfer the remaining table 4-4. address offset encoding a1 a0 offset 0 0 +0 byte 0 1 +1 byte 1 0 +2 bytes 1 1 +3 bytes table 4-5. data bus requirements for read cycles transfer size size address long-word port external data bytes required word port external data bytes required byte port external data bytes required siz1 siz0 a1 a0 d31:d24 d23:d16 d15:d8 d7:d0 d31:d24 d23:d16 d31:d24 byte 0 1 0 0 op3 x x x op3 x op3 0 1 0 1 x op3 x x x op3 op3 0 1 1 0 x x op3 x op3 x op3 0 1 1 1 x x x op3 x op3 op3 word 1 0 0 0 op2 op3 x x op2 op3 op2 1 0 0 1 x op2 op3 x x op2 op2 1 0 1 0 x x op2 op3 op2 op3 op2 1 0 1 1 x x x op2 x op2 op2 3 bytes 1 1 0 0 op1 op2 op3 x op1 op2 op1 1 1 0 1 x op1 op2 op3 x op1 op1 1 1 1 0 x x op1 op2 op1 op2 op1 1 1 1 1 x x x op1 x op1 op1 long word 0 0 0 0 op0 op1 op2 op3 op0 op1 op0 0 0 0 1 x op0 op1 op2 x op0 op0 0 0 1 0 x x op0 op1 op0 op1 op0 0 0 1 1 x x x op0 x op0 op0
bus operation 4-10 mc68360 user? manual motorola 16 bits. siz0 and siz1 indicate that a word remains to be transferred; a0 and a1 indicate that the word corresponds to an offset of two from the base address. the multiplexer follows the pattern corresponding to this configuration of the size and address signals and places the two least significant bytes of the long word on the word portion of the bus (d16?31). the bus cycle transfers the remaining bytes to the word-size port. figure 4-5 shows the tim- ing of the bus transfer signals for this operation. figure 4-4. example of long-word transfer to word port table 4-6. quicc internal to external data bus multiplexer?rite cycle transfer size size address external data bus connection siz1 siz0 a1 a0 d31:d24 d23:d16 d15:d8 d7:d0 byte 0100op3 x x x 0101op3op3 x x 0110op3 x op3 x 0111op3op3 x op3 word 1000op2op3 x x 1001op2op2op3 x 1010op2op3op2op3 1011op2op2 x op2 3 bytes 1100op1op2op3 x 1101op1op1op2op3 1110op1op2op1op2 1111op1 x op2op1 long word 0000op0op1op2op3 0001op0op0op1op2 0010op0op1op0op1 0011op0op0 x op0 data bus d31 d16 long-word operand 0p0 0p1 0p2 0p3 31 0 word memory msb lsb 0p0 0p1 0p2 0p3 mc68360 siz1 siz0 a1 a0 0000 1010 memory control dsack1 dsack0 lh lh
bus operation motorola mc68360 user? manual 4-11 figure 4-5. long-word operand write timing (16-bit data port) figure 4-6 shows a word transfer to an 8-bit bus port. like the preceding example, this example requires two bus cycles. each bus cycle transfers a single byte. the size signals for the first cycle specify two bytes; for the second cycle, they specify one byte. figure 4-7 shows the associated bus transfer signal timing. 4.2.2 misaligned operands since operands may reside at any byte boundaries, they may be misaligned. a byte operand is properly aligned at any address; a word operand is misaligned at an odd address; a long word is misaligned at an address that is not evenly divisible by four. the mc68302, mc68000/mc68008, mc68010, and mc68340 implementations allow long-word transfers on odd-word boundaries but force exceptions if word or long-word operand transfers are attempted at odd-byte addresses. although the quicc does not enforce any alignment restrictions for data operands (including pc relative data addresses), some performance degradation occurs when additional bus cycles are required for long-word or word operands word write long-word operand write to 16-bit port s0 s2 s4 s0 s2 s4 clko1 a31?2 a1 a0 fc3?c0 siz1 siz0 r/w as ds dsack1 dsack0 d31?24 d23?16 word write 0p0 0p1 0p2 0p3
bus operation 4-12 mc68360 user? manual motorola that are misaligned. for maximum performance, data items should be aligned on their nat- ural boundaries. all instruction words and extension words must reside on word boundaries. attempting to prefetch an instruction word at an odd address causes an address error exception. figure 4-6. example of word transfer to byte port data bus d31 d24 word operand 0p2 0p3 15 0 byte memory 0p2 0p3 mc68360 siz1 siz0 a1 a0 1000 0101 memory control dsack1 dsack0 l h l h
bus operation motorola mc68360 user? manual 4-13 figure 4-7. word operand write timing (8-bit data port) figure 4-8 shows the transfer of a long-word operand to an odd address in word-organized memory, which requires three bus cycles. for the first cycle, the sizx signals specify a long- word transfer, and the address offset (a2?0) is 001. since the port width is 16 bits, only the first byte of the long word is transferred. the slave device latches the byte and acknowl- edges the data transfer, indicating that the port is 16 bits wide. when the processor starts the second cycle, the sizx signals specify that three bytes remain to be transferred with an address offset (a2?0) of 010. the next two bytes are transferred during this cycle. the pro- cessor then initiates the third cycle, with the sizx signals indicating one byte remaining to be transferred. the address offset (a2?0) is now 100; the port latches the final byte, and the operation is complete. figure 4-9 shows the associated bus transfer signal timing. byte write word operand write s0 s2 s4 s0 s2 s4 clko1 a31?2 a1 a0 fc3?c0 siz1 siz0 r/w as ds dsack1 dsack0 d31?24 d23?16 byte write d15?8 d7?0 op3 op2 op3 op2 op3 op3 op3 op3
bus operation 4-14 mc68360 user? manual motorola figure 4-8. misaligned long-word transfer to word port example data bus d31 d16 long-word operand 0p0 0p1 0p2 0p3 31 0 word memory msb lsb xxx 0p0 0p1 0p2 mc68360 siz1 siz0 a2 a1 0000 1101 memory control dsack1 dsack0 l h l h xxx op3 lh a0 1 0 01100
bus operation motorola mc68360 user? manual 4-15 figure 4-9. misaligned long-word transfer to word port timing figure 4-10 and figure 4-11 show a word transfer to an odd address in word-organized memory. this example is similar to the one shown in figure 4-8 and figure 4-9 except that the operand is word sized and the transfer requires only two bus cycles. byte write long-word operand write s0 s2 s4 s0 s2 s4 clko1 a31?2 a1 a0 fc3?c0 siz1 siz0 r/w as ds dsack1 dsack0 d31?24 d23?16 word write d15?8 d7?0 s0 s2 s4 0p0 0p0 0p1 0p2 0p1 0p2 0p1 0p2 0p3 0p3 0p3 0p3 byte write
bus operation 4-16 mc68360 user? manual motorola figure 4-10. misaligned word transfer to word port example mc68360 siz1 siz0 a2 a1 1 0 0 0 1 0 1 0 1 0 a0 memory control dsack1 dsack0 lh lh op2 op3 15 0 word operand data bus d31 d16 word memory msb lsb xxx 0p3 0p2 xxx
bus operation motorola mc68360 user? manual 4-17 figure 4-11. misaligned word transfer to word port timing figure 4-12 and figure 4-13 show an example of a long-word transfer to an odd address in long-word-organized memory. in this example, a long-word access is attempted beginning at the least significant byte of a long-word-organized memory. only one byte can be trans- ferred in the first bus cycle. the second bus cycle then consists of a three-byte access to a long-word boundary. since the memory is long-word organized, no further bus cycles are necessary. word operand write to a1/a0 = 01 s0 s2 s4 s0 s2 s4 clko1 a31?2 a1 a0 fc3?c0 siz1 siz0 r/w as ds dsack1 dsack0 d31?24 d23?16 word write d15?8 d7?0 0p2 0p2 0p3 0p2 0p3 0p3 0p3 0p3 byte write
bus operation 4-18 mc68360 user? manual motorola figure 4-12. misaligned long-word transfer to long-word port example mc68ec030 siz1 siz0 a2 a1 0 0 0 1 1 1 1 1 0 0 a0 memory control dsack1 dsack0 l ll 0p0 0p1 15 0 long-word operand data bus d31 d0 long-word memory msb umb xxx 0p1 0p2 xxx 0p2 0p3 0p0 0p3 0p0 xxx lmb lsb l
bus operation motorola mc68360 user? manual 4-19 figure 4-13. misaligned long-word transfer to long-word port timing 4.2.3 effects of dynamic bus sizing and operand misalignment the combination of operand size, operand alignment, and port size determines the number of bus cycles required to perform a particular memory access. table 4-7 lists the number of bus cycles required for different operand sizes to different port sizes with all possible align- ment conditions for write cycles and read cycles. long-word operand write s0 s2 s4 s0 s2 s4 clko1 a31?2 a1 a0 fc2?c0 siz1 siz0 r/w as ds dsack1 dsack0 d31?24 d23?16 byte write d15?8 d7?0 0p0 0p0 0p1 0p0 0p1 0p2 0p3 0p1 3-byte write
bus operation 4-20 mc68360 user? manual motorola notes: 1. data port size?2 bits:16 bits:8 bits 2. instruction reads can either be two words from an even-word boundary, or one word from an odd-word boundary. this table verifies that bus cycle throughput is significantly affected by port size and align- ment. the quicc system designer and programmer should be aware of and account for these effects, particularly in time-critical applications. if the required instruction begins at an even-word boundary, the processor prefetches a long word (up to two instructions) by reading a long word from a long-word address (a1?0 = 00), regardless of port size. when the required instruction begins at an odd-word boundary, the processor reads 16-bits only, from the odd-word boundary. refer to section 5 cpu32+ for a complete description of the pipeline operation. 4.2.4 bus operation the quicc bus is asynchronous, allowing external devices connected to the bus to operate at clock frequencies different from the clock for the quicc. bus operation uses the hand- shake lines (as , ds , dsack1 , dsack0 , berr , and halt ) to control data transfers. as signals a valid address on the address bus, and ds is used as a condition for valid data on a write cycle. decoding the sizx outputs and lower address lines (a1?0) provides strobes that select the active portion of the data bus. the slave device (memory or peripheral) responds by placing the requested data on the correct portion of the data bus for a read cycle or by latching the data on a write cycle; the slave asserts the dsack1 /dsack0 com- bination that corresponds to the port size to terminate the cycle. alternatively, the sim60 can be programmed to assert the dsack1 /dsack0 combination internally and respond for the slave. if no slave responds or the access is invalid, external control logic may assert berr or berr with halt to abort or retry the bus cycle, respec- tively. dsackx can be asserted before the data from a slave device is valid on a read cycle. the length of time that dsackx may precede data must not exceed a specified value in any asynchronous system to ensure that valid data is latched into the quicc. (see section 10 electrical characteristics for timing parameters.) note that no maximum time is specified from the assertion of as to the assertion of dsackx . although the quicc can transfer data in a minimum of three clock cycles when the cycle is terminated with dsackx , the quicc inserts wait cycles in clock-period incre- ments until dsackx is recognized. berr and/or halt can be asserted after dsackx is asserted. berr and/or halt must be asserted within the time specified after dsackx is table 4-7. memory alignment and port size influence on write bus cycles number of bus cycles a1?0 00 01 10 11 instruction 1 1:2:4 n/a n/a n/a byte operand 1:1:1 1:1:1 1:1:1 1:1:1 word operand 1:1:2 1:2:2 1:1:2 2:2:2 long-word operand 1:2:4 2:3:4 2:2:4 2:3:4
bus operation motorola mc68360 user? manual 4-21 asserted in any asynchronous system. if this maximum delay time is violated, the quicc may exhibit erratic behavior. 4.2.5 synchronous operation with dsackx although cycles terminated with dsackx are classified as asynchronous, cycles terminated with dsackx can also operate synchronously in that signals are interpreted relative to clock edges. the devices that use these cycles must synchronize the response to the quicc clock (clko1) to be synchronous. since the devices terminate bus cycles with dsackx , the dynamic bus sizing capabilities of the quicc are available. the minimum cycle time for these cycles is also three clocks. to support systems that use the system clock to generate dsackx and other asynchronous inputs, the asynchronous input setup time and the asyn- chronous input hold time are given. if the setup and hold times are met for the assertion or negation of a signal, such as dsackx , the quicc is guaranteed to recognize that signal level on that specific falling edge of the system clock. if the assertion of dsackx is recog- nized on a particular falling edge of the clock, valid data is latched into the quicc (for a read cycle) on the next falling clock edge if the data meets the data setup time. in this case, the parameter for asynchronous operation can be ignored. the timing parameters are described in section 10 electrical characteristics. if a system asserts dsackx for the required window around the falling edge of s2 and obeys the proper bus protocol by maintaining dsackx (and/or berr /halt ) until and throughout the clock edge that negates as (with the appropriate asynchronous input hold time), no wait states are inserted. the bus cycle runs at its maximum speed for bus cycles terminated with dsackx (three clocks per cycle). when berr (or berr and halt ) is asserted after dsackx , berr (and halt ) must meet the appropriate setup time prior to the falling clock edge one clock cycle after dsackx is recognized. this setup time is critical, and the quicc may exhibit erratic behavior if it is violated. when operating synchronously, the data-in setup and hold times for synchronous cycles may be used instead of the timing requirements for data relative to ds . 4.2.6 fast termination cycles with an external device that has a fast access time, the memory controller circuits can pro- vide a two-clock external bus transfer. since the memory controller circuits are driven from the system clock, the bus cycle termination is inherently synchronized with the system clock. refer to section 6 system integration module (sim60) for more information on chip selects and the dram controller. to use the fast termination (cycle length is two clocks) option, an external device should be fast enough to have data ready, within the specified setup time, by the falling edge of s4. figure 4-14 shows the dsackx timing for a read with two wait states, followed by a fast termination read and write.
bus operation 4-22 mc68360 user? manual motorola figure 4-14. fast termination timing notes when using the fast termination option (cycle length is two clocks), ds is asserted only in a read cycle, not in a write cycle. dsackx is only internally asserted for fast termination cycles. 4.3 data transfer cycles the transfer of data between the quicc and other devices involves the following signals: address bus a31?0 data bus d31?0 control signals the address and data buses are both parallel, nonmultiplexed buses. the bus master moves data on the bus by issuing control signals, and the bus uses a handshake protocol to ensure correct movement of the data. in all bus cycles, the bus master is responsible for deskewing all signals it issues at both the start and end of the cycle. in addition, the bus mas- ter is responsible for deskewing the acknowledge and data signals from the slave devices. the following paragraphs define read, write, and read-modify-write cycle operations. each bus cycle is defined as a succession of states that apply to the bus operation. these states are different from the quicc states described for the cpu32+. the clock cycles used in the descriptions and timing diagrams of data transfer cycles are independent of the clock fre- quency. bus operations are described in terms of external bus states. clko1 r/w s0 s2 sw sw s4 s0 s4 s0 s4 s0 as ds dsackx d31?0 s1 s3 s5 s1 s5 s1 s5 sw * sw * fast termination read two wait states in read * dsackx only internally asserted for fast termination cycles. fast termination write
bus operation motorola mc68360 user? manual 4-23 4.3.1 read cycle during a read cycle, the quicc receives data from a memory or peripheral device. if the instruction specifies a long-word operation, the quicc attempts to read four bytes at once. for a word operation, the quicc attempts to read two bytes at once. for a byte operation, the quicc reads one byte. the section of the data bus from which each byte is read depends on the operand size, address signals (a1, a0), and the port size. refer to 4.2.1 dynamic bus sizing and 4.2.2 misaligned operands for more information. figure 4-15 shows a long-word read cycle flowchart and figure 4-16 illustrates a byte read cycle flowchart. figure 4-17 and figure 4-18 show functional read cycles timing diagrams specified in terms of clock periods. figure 4-15. long-word read cycle flowchart figure 4-16. byte read cycle flowchart bus master slave address device 1) set r/w to read 2) drive address on a31?0 3) drive function code on fc3?c0 4) drive sizx pins for four btyes acquire data 1) latch data 5) assert as, oe and ds start next cycle 2) negate as, oe and ds 1) decode address 2) place data on d31?0 present data 3) drive dsackx signals terminate cycle 1) remove data from d31?0 2) negate dsackx start next cycle present data 1) decode address 2) place data on d31?24, or d23?6, or d15?8, or d7?0. 3) assert dsackx terminate cycle 1) remove data from d31?0 2) negate dsackx bus master address device 1) set r/w to read 2) drive address on a31?0 3) drive function code on fc3?c0 4) drive size (siz1?iz0) (one byte) 5) assert as, ds, and oe terminate output transfer 2) negate as, ds, and oe 1) latch data external device
bus operation 4-24 mc68360 user? manual motorola figure 4-17. byte and word read cycles?2-bit port timing word read s0 s2 s4 s0 s2 s4 clko1 a31?2 a1 a0 fc3?c0 siz1 siz0 r/w as ds dsack1 dsack0 d31?24 d23?16 byte read d15?8 d7?0 s0 s2 s4 0p2 0p3 0p3 0p3 word byte byte read oe
bus operation motorola mc68360 user? manual 4-25 figure 4-18. long-word read?6-bit and 32-bit port timing state 0?he read cycle starts in state 0 (s0). during s0, the quicc places a valid address on a31?0 and valid function codes on fc3?c0. the function codes select the address space for the cycle. the quicc drives r/w high for a read cycle. siz1 and siz0 become valid, indicating the number of bytes requested for transfer. word read s0 s2 s4 s0 s2 s4 clko1 a31?2 a1 a0 fc3?c0 siz1 siz0 r/w as ds dsack1 dsack0 d31?24 d23?16 word read d15?8 d7?0 s0 s2 s4 0p0 0p1 0p3 0p3 long word word long-word read from 32-bit port 0p2 0p1 0p0 0p2 long word long-word operand read from 16-bit port oe
bus operation 4-26 mc68360 user? manual motorola state 1?ne-half clock later, in state 1 (s1), the quicc asserts as indicating a valid address on the address bus. the quicc also asserts ds and oe during s1. the selected device uses r/w , siz1 or siz0, a0, a1, ds, and oe to place its information on the data bus. any or all of the bytes (d31?24, d23?16, d15?8, and d7?0) are selected by siz1, siz0, a1, and a0. concurrently, the selected device asserts dsackx . state 2?s long as at least one of the dsackx signals is recognized on the falling edge of s2 (meeting the asynchronous input setup time requirement), data is latched on the falling edge of s4, and the cycle terminates. state 3?f dsackx is not recognized by the start of state 3 (s3), the quicc inserts wait states instead of proceeding to states 4 and 5. to ensure that wait states are inserted, both dsack1 and dsack0 must remain negated throughout the asynchronous input setup and hold times around the end of s2. if wait states are added, the quicc continues to sample dsackx on the falling edges of the clock until one is recognized. state 4?t the falling edge of state 4 (s4), the quicc latches the incoming data and sam- ples dsackx to get the port size. state 5?he quicc negates as , ds, and oe during state 5 (s5). it holds the address valid during s5 to provide address hold time for memory systems. r/w , siz1, siz0, and fc3 fc0 also remain valid throughout s5. the external device keeps its data and dsackx sig- nals asserted until it detects the negation of as , ds, or oe (whichever it detects first). the device must remove its data and negate dsackx within approximately one clock period after sensing the negation of as , ds , or oe . dsackx signals that remain asserted beyond this limit may be prematurely detected for the next bus cycle. 4.3.2 write cycle during a write cycle, the quicc transfers data to memory or a peripheral device. figure 4- 19 is a flowchart of a write cycle operation for a long-word transfer. figure 4-20 shows the functional write cycle timing diagram specified in clock periods for two write cycles (between two read cycles with no idle time) for a 32-bit port. figure 4-19. write cycle flowchart processor address device 1) set r/w to write 2) drive address on a31?0 3) drive function code on fc3?c0 4) drive size (siz1?iz0) 5) assert address strobe (as) and wex 6) drive data lines d31?0 7) assert data strobe (ds) acquire data start next cycle present data 1) decode address 2) place data on d31?0 3) assert data transfer and size acknowledge (dsackx) terminate cycle 1) negate dsackx external device 1) negate as and ds and wex 2) remove data from d31?0
bus operation motorola mc68360 user? manual 4-27 figure 4-20. read-write-read cycles?2-bit port state 0?he write cycle starts in s0. during s0, the quicc places a valid address on a31 a0 and valid function codes on fc3?c0. the function codes select the address space for the cycle. the quicc drives r/w low for a write cycle. siz1 and siz0 become valid, indi- cating the number of bytes to be transferred. state 1?ne-half clock later during s1, the quicc asserts as , indicating a valid address on the address bus. during this state, any or all of the byte write enables (we0 , we1 , we2, and we3 ) are asserted simultaneously with as . state 2?uring s2, the quicc places the data to be written onto d31?0 and samples dsackx at the end of s2. write a31?2 a1 a0 fc3?c0 siz1 siz0 r/w as ds dsack1 dsack0 d31?0 long word clko1 write read s0 s2 s4 s0 s2 s4 s0 s2 s4 s0 s2 sw sw s4 read with wait states note: we3?e0 is not shown.
bus operation 4-28 mc68360 user? manual motorola state 3?he quicc asserts ds during s3, indicating that data is stable on the data bus. as long as at least one of the dsackx signals is recognized by the end of s2 (meeting the asynchronous input setup time requirement), the cycle terminates one clock later. if dsackx is not recognized by the start of s3, the quicc inserts wait states instead of pro- ceeding to s4 and s5. to ensure that wait states are inserted, both dsack1 and dsack0 must remain negated throughout the asynchronous input setup and hold times around the end of s2. if wait states are added, the quicc continues to sample dsackx on the falling edges of the clock until one is recognized. the selected device uses the four write enables lines or r/w , siz1, siz0, a1, and a0 to latch data from the appropriate byte(s) of the data bus (d31?24, d23?16, d15?8, and d7?0). we3 ?e0 or siz1, siz0, a1, and a0 select the bytes of the data bus. if it has not already done so, the device asserts dsackx to signal that it has successfully stored the data. state 4?he quicc issues no new control signals during s4. state 5?he quicc negates we3 ?e0 , as, and ds during s5. it holds the address and data valid during s5 to provide address hold time for memory systems. r/w , siz1, siz0, and fc3?c0 also remain valid throughout s5. the external device must keep dsackx asserted until it detects the negation of as or ds (whichever it detects first). the device must negate dsackx within approximately one clock period after sensing the negation of as or ds . dsackx signals that remain asserted beyond this limit may be prematurely detected for the next bus cycle. 4.3.3 read-modify-write cycle the read-modify-write cycle performs a read, conditionally modifies the data in the arith- metic logic unit, and may write the data out to memory. in the quicc, this operation is indi- visible, providing semaphore capabilities for multiprocessor systems. during the entire read- modify-write sequence, the quicc asserts rmc to indicate that an indivisible operation is occurring. the quicc does not issue a bus grant (bg ) signal in response to a bus request (br ) signal during this operation. figure 4-21 is an example of a functional timing diagram of a read-modify-write instruction specified in terms of clock periods.
bus operation motorola mc68360 user? manual 4-29 figure 4-21. read-modify-write cycle timing state 0?he quicc asserts rmc in s0 to identify a read-modify-write cycle. the quicc places a valid address on a31?0 and valid function codes on fc3?c0. the function codes select the address space for the operation. siz1 and siz0 become valid in s0 to indi- cate the operand size. the quicc drives r/w high for the read cycle. state 1?ne-half clock later in s1, the quicc asserts as , indicating a valid address on the address bus. the quicc also asserts oe and ds during s1. state 2?he selected device uses oe , r/w , siz1, siz0, a0, and ds to place information on the data bus. any of the bytes (d31?24, d23?16, d15?8, and d7?0) are selected by siz1, siz0, a1, and a0. concurrently, the selected device may assert dsackx . state 3?s long as at least one of the dsackx signals is recognized by the end of s2 (meeting the asynchronous input setup time requirement), data is latched on the next falling edge of the clock, and the cycle terminates. if dsackx is not recognized by the start of s3, the quicc inserts wait states instead of proceeding to s4 and s5. to ensure that wait states are inserted, both dsack1 and dsack0 must remain negated throughout the asynchro- clk a31?0 fc3?c0 s0 s2 s4 s2 s4 s0 s0 r/w siz1?iz0 as ds dsackx d31?0 read write indivisible cycle rmc o1 note: oe and we3?e0 are not shown.
bus operation 4-30 mc68360 user? manual motorola nous input setup and hold times around the end of s2. if wait states are added, the quicc continues to sample dsackx on the falling edges of the clock until one is recognized. state 4?t the end of s4, the quicc latches the incoming data. state 5?he quicc negates oe , as, and ds during s5. if more than one read cycle is required to read in the operand(s), s0?5 are repeated for each read cycle. when finished reading, the quicc holds the address, r/w , and fc3?c0 valid in preparation for the write portion of the cycle. the external device keeps its data and dsackx signals asserted until it detects the negation of as or ds (whichever it detects first). the device must remove the data and negate dsackx within approximately one clock period after sensing the negation of as or ds . dsackx signals that remain asserted beyond this limit may be prematurely detected for the next portion of the operation. idle states?he quicc does not assert any new control signals during the idle states, but it may internally begin the modify portion of the cycle at this time. s0?5 are omitted if no write cycle is required. if a write cycle is required, r/w remains in the read mode until s0 to prevent bus conflicts with the preceding read portion of the cycle; the data bus is not driven until s2. state 0?he quicc drives r/w low for a write cycle. depending on the write operation to be performed, the address lines may change during s0. state 1?n s1, the quicc asserts as , indicating a valid address on the address bus. dur- ing this state, we0 , we1 , we2, and/or we3 assert simultaneously with as . state 2?uring s2, the quicc places the data to be written onto d31?0. state 3?he quicc asserts ds during s3, indicating stable data on the data bus. as long as at least one of the dsackx signals is recognized by the end of s2 (meeting the asyn- chronous input setup time requirement), the cycle terminates one clock later. if dsackx is not recognized by the start of s3, the quicc inserts wait states instead of proceeding to s4 and s5. to ensure that wait states are inserted, both dsack1 and dsack0 must remain negated throughout the asynchronous input setup and hold times around the end of s2. if wait states are added, the quicc continues to sample dsackx on the falling edges of the clock until one is recognized. the selected device uses we3 ?e0 or r/w , ds , siz1, siz0, a1, and a0 to latch data from the appropriate section(s) of the data bus (d31?24, d23 d16, d15?8, and d7?0). we3 ?e0 or siz1, siz0, a1, and a0 select the data bus sec- tions. if it has not already done so, the device asserts dsackx when it has successfully stored the data. state 4?he quicc issues no new control signals during s4. state 5?he quicc negates we3 ?e0 , as , and ds during s5. it holds the address and data valid during s5 to provide address hold time for memory systems. r/w and fc3?c0 also remain valid throughout s5. if more than one write cycle is required, s0?5 are repeated for each write cycle. the external device keeps dsackx asserted until it detects the negation of as or ds (whichever it detects first). the device must remove its data and
bus operation motorola mc68360 user? manual 4-31 negate dsackx within approximately one clock period after sensing the negation of as or ds . 4.4 cpu space cycles fc2?c0 select user and supervisor program and data areas. the area selected by function code fc3?c0 = $7 is classified as the cpu space. the breakpoint acknowledge, lpstop broadcast, module base address register access, and interrupt acknowledge cycles described in the following paragraphs use cpu space. the cpu space type, which is encoded on a19?16 during a cpu space operation, indicates the function that the quicc is performing. on the quicc, four of the encodings are implemented as shown in figure 4- 22. all unused values are reserved by motorola for additional cpu space types. figure 4-22. cpu space address encoding 4.4.1 breakpoint acknowledge cycle the breakpoint acknowledge cycle allows external hardware to insert an instruction directly into the instruction pipeline as the program executes. the breakpoint acknowledge cycle is generated by the execution of the bkpt instruction, the internal breakpoint logic, or the assertion of the bkpt pin. the t-bit state (shown in figure 4-22) differentiates a software breakpoint cycle (t = 0) from a hardware breakpoint cycle (t = 1). when a software bkpt is executed, the quicc performs a word read from cpu space, type 0, at an address corresponding to the breakpoint number (bits [2?] of the bkpt opcode) on a4?2, and the t-bit (a1) is cleared. if this bus cycle is terminated with berr (i.e., no instruction word is available), the quicc then performs illegal instruction exception pro- cessing. if the bus cycle is terminated by dsackx , the quicc uses the data on the bus to replace the bkpt instruction in the internal instruction pipeline and then begins execution of that instruction. 0000000000000000000 t0 bkpt# 19 16 cpu space cycles function code breakpoint acknowledge 0 0 00000 111111111111111110 19 16 0 address bus 1111 1 11111111111 1 level 19 16 0 cpu space type field 000000111111111100000000 19 16 0 111 0 low-power stop broadcast 111 0 interrupt acknowledge 11 1 0 11 1 0 module base address register access 0 0 3 3 3 3 0 0 0 0 0 0 0 0 0 0 31 31 111 1 1111 1 111 000 0 0000 0000 0000 31 31
bus operation 4-32 mc68360 user? manual motorola when the cpu32+ acknowledges hardware breakpoint (bkpt pin assertion or internal breakpoint logic) with background mode disabled, the cpu32+ performs a word read from cpu space, type 0, at an address corresponding to all ones on a4?2 (bkpt#7), and the t-bit (a1) is set. if this bus cycle is terminated by berr , the quicc performs hardware breakpoint exception processing. if this bus cycle is terminated by dsackx , the quicc ignores data on the data bus and continues execution of the next instruction. note the bkpt pin is sampled on the same clock phase as data and is latched with data as it enters the cpu32+ pipeline. if bkpt is asserted for only one bus cycle and a pipeline flush occurs be- fore bkpt is detected by the cpu32+, bkpt is ignored. to en- sure detection of bkpt by the cpu32+, bkpt can be asserted until a breakpoint acknowledge cycle is recognized. when the quicc is configured for a 32-bit bus, the cpu32+ can fetch two instructions simultaneously. since there is only one bkpt pin, the external user cannot break individually on those instructions, but rather must break on both, causing the bkpt exception to be taken after the first instruction and before the second instruction. the internal breakpoint logic, however, can individually assert a breakpoint for either instruction. (see the bkar and bkcr discussion in section 6 system integration module (sim60) for details). the breakpoint operation flowchart is shown in figure 4-23. figure 4-24 and figure 4-25 show the timing diagrams for the breakpoint acknowledge cycle with instruction opcodes supplied on the cycle and with an exception signaled, respectively.
bus operation motorola mc68360 user? manual 4-33 figure 4-23. breakpoint operation flowchart breakpoint acknowledge if breakpoint instruction executed: 1) set r/w to read 2) set function code to cpu space 3) place cpu space type 0 on a19?16 4) place breakpoint number on a4?2 5) clear t-bit (a1) 6) set sizx to word 7) assert as and ds if bkpt pin or internal logic asserted bkpt internally: 1) set r/w to read 2) set function code to cpu space 3) place cpu space type 0 on a19?16 4) place all ones on a4?2 5) set t-bit (a1) to one 6) set sizx to word 7) assert as and ds (a) (b) if breakpoint instruction executed: 1) place replacement opcode on data bus 2) assert dsackx -or- 1) assert berr to initiate exception processing if bkpt pin asserted: 1) assert dsackx -or- 1) assert berr to initiate exception processing 1) negate dsackx or berr processor external device if breakpoint instruction executed and dsackx is asserted: 1) latch data 2) negate as and ds 3) go to (a) if bkpt pin asserted and dsackx is asserted: 1) negate as and ds 2) go to (a) if berr asserted: 1) negate as and ds 2) go to (b) if breakpoint instruction executed: 1) place latched data in instruction pipeline 2) continue processing if bkpt pin asserted: 1) continue processing if breakpoint instruction executed: 1) initiate illegal instruction processing if bkpt pin asserted: 1) initiate hardware breakpoint processing
bus operation 4-34 mc68360 user? manual motorola figure 4-24. breakpoint acknowledge cycle timing (opcode returned) fc3?c0 siz0 d31?24 r/w dsackx berr halt as ds bkpt d23?16 siz1 cpu space fetched instruction execution breakpoint acknowledge instruction word fetch a15?5, a0 a19?16 clko1 a31?20 a4?1 s0 s1 s2 s3 s4 s5 s0 s1 s2 s3 s4 s5 s0 s1 s2 s3 s4 s5 s0 breakpoint encoding (0000) breakpoint number/t-bit breakpoint occurs read
bus operation motorola mc68360 user? manual 4-35 figure 4-25. breakpoint acknowledge cycle timing (exception signaled) 4.4.2 lpstop broadcast cycle the lpstop broadcast cycle is generated by the cpu32+ executing the lpstop instruc- tion. the external bus interface must get a copy of the interrupt mask level from the cpu32+, exception stacking fc3?c0 siz0 d31?24 r/w dsackx berr halt as ds bkpt d23?16 siz1 cpu space a19?16 a15?5, a0 clko1 a31?20 a4?1 s0 s1 s2 s3 s4 s5 breakpoint encoding (0000) breakpoint number/t-bit s0 s1 s2 s3 s4 s5 s0 s1 s2 s3 s4 s5 s0 breakpoint occurs read breakpoint acknowledge bus error asserted
bus operation 4-36 mc68360 user? manual motorola so the cpu32+ performs a cpu space type 3 write with the interrupt mask level (i2?0) encoded on bits 2? of the data bus, as shown in the following figure. the cpu space type 3 cycle waits for the bus to be available, and is shown externally to indicate to external devices that the quicc is going into lpstop mode. if an external device requires addi- tional time to prepare for entry into lpstop mode, entry can be delayed by asserting halt . the sim60 provides internal dsackx response to this cycle. for more information on how the sim60 responds to lpstop mode, see section 6 system integration module (sim60) for details. 4.4.3 module base address register (mbar) access all internal module registers, including the sim60, occupy a single 8-kbyte block that is locat- able along 8-kbyte boundaries. the location is fixed by writing the desired base address of the sim60 block to the mbar using the moves instruction. the mbar is only accessible in cpu space at address $0003ff00. the sfc or dfc register must indicate cpu space (fc2?c0 = $7), using the movec instruction, before accessing mbar. refer to section 6 system integration module (sim60) for additional information on the mbar. 4.4.4 interrupt acknowledge bus cycles the cpu32+ makes an interrupt pending in three cases. the first case occurs when a peripheral device signals the cpu32+ (with the irq7 ?rq1 signals) that the device requires service and the internally synchronized value on these signals indicates a higher priority than the interrupt mask in the status register. the second case occurs when a transition has occurred in the case of a level 7 interrupt. a recognized level 7 interrupt must be removed for one clock cycle before a second level 7 can be recognized. the third case occurs if, upon returning from servicing a level 7 interrupt, the request level stays at 7 and the processor mask level changes from 7 to a lower level, a second level 7 is recognized. the cpu32+ takes an interrupt exception for a pending interrupt within one instruction boundary (after processing any other pending exception with a higher priority). the following paragraphs describe the various kinds of interrupt acknowledge bus cycles that can be executed as part of interrupt exception processing. 4.4.4.1 interrupt acknowledge cycle?erminated normally. when the cpu32+ processes an interrupt exception, it performs an interrupt acknowledge cycle to obtain the number of the vector that contains the starting location of the interrupt service rou- tine. some interrupting devices have programmable vector registers that contain the inter- rupt vectors for the routines they use. the following paragraphs describe the interrupt acknowledge cycle for these devices. other interrupting conditions or devices cannot supply a vector number and use the autovector cycle described in 4.4.4.2 autovector interrupt acknowledge cycle. 1514131211109876543210 i2i1i0
bus operation motorola mc68360 user? manual 4-37 the interrupt acknowledge cycle is a read cycle. it differs from the read cycle described in 4.3.1 read cycle in that it accesses the cpu address space. specifically, the differences are as follows: 1. fc3?c0 are set to $7 (fc3/fc2/fc1/fc0 = 0111) for cpu address space. 2. a3, a2, and a1 are set to the interrupt request level, and the iackx strobe correspond- ing to the current interrupt level is asserted. (either the function codes and address sig- nals or the iackx strobes can be monitored to determine that an interrupt acknowledge cycle is in progress and the current interrupt level.) 3. the cpu32+ space type field (a19?16) is set to $f (interrupt acknowledge). 4. other address signals (a31?20, a15?4, and a0) are set to one. the responding device places the vector number on the data bus during the interrupt acknowledge cycle. beyond this, the cycle is terminated normally with dsackx . figure 4-26 is a flowchart of the interrupt acknowledge cycle; figure 4-27 shows the timing for an interrupt acknowledge cycle terminated with dsackx . figure 4-26. interrupt acknowledge cycle flowchart start next cycle release 1) negate dsackx quicc interrupting device request interrupt grant interrupt provide vector number acquire vector number 1) latch vector number 2) negate as, ds, and oe 1) synchronize irq7?rq1 2) compare irq7?rq1 to mask level and wait for instruction to complete 3) assert bclro 4) place interrupt level on a1?3; type field (a19?16) = $f 5) set r/w to read 6) set fc3?c0 to 0111 7) drive sizx pins to indicate a one-byte transfer 8) negate bclro. 9) assert as, ds, and oe 1) place vector number on least significant byte of data port (depends on port size) 2) assert dsackx (or avec if no vector number)
bus operation 4-38 mc68360 user? manual motorola figure 4-27. interrupt acknowledge cycle timing 4.4.4.2 autovector interrupt acknowledge cycle. when the interrupting device cannot supply a vector number, it requests an automatically generated vector (autovector). instead of placing a vector number on the data bus and asserting dsackx , the device asserts avec to terminate the cycle. the dsackx signals may not be asserted clko1 a31?4 fc3?c0 s0 s2 s4 s2 s4 s0 siz0 dsackx d23?16 r/w as ds a3?1 a0 siz1 d31?24 s0 s1 s2 irq7?rq1 1 byte interrupt level read cycle internal arbitration iack cycle iack7?ack1 write stack vector from 16-bit port vector from 8-bit port cpu space 0? clocks* * internal arbitration may take between 0? clock cycles.
bus operation motorola mc68360 user? manual 4-39 during an interrupt acknowledge cycle terminated by avec . the vector number supplied in an autovector operation is derived from the interrupt level of the current interrupt. when the avec signal is asserted instead of dsackx during an interrupt acknowledge cycle, the quicc ignores the state of the data bus and internally generates the vector number (the sum of the interrupt level plus 24 ($18)). avec is multiplexed with iack5 . the avec bit in the port e pin assignment register (pepar) controls whether the avec /iack5 pin is used as an autovector input or as iack5 (see section 6 system integration module (sim60) for additional information). avec is only sampled during an interrupt acknowledge cycle; during all other cycles, avec is ignored. additionally, avec can be internally generated for external devices by programming the autovector register (note that in this case avec pin will not be asserted externally). seven distinct autovectors can be used, corresponding to the seven levels of interrupt available with signals irq7 ?rq1 . figure 4-28 shows the timing for an autovector operation.
bus operation 4-40 mc68360 user? manual motorola figure 4-28. autovector operation timing 4.4.4.3 spurious interrupt cycle. requested interrupts, whether internal or exter- nal, are arbitrated internally. when no internal module (including the sim60, which responds for external requests) responds during an interrupt acknowledge cycle by arbitrating for the read cycle internal arbitration iack cycle write stack s0 s2 s4 s2 s4 s0 s0 s1 s2 1 byte interrupt level clko1 a31?4 fc3?c0 siz0 dsackx d31?0 r/w as ds a3?1 a0 siz1 avec irq7?rq1 iack7?ack1 cpu space 0? clocks* * internal arbitration may take between 0? clock cycles.
bus operation motorola mc68360 user? manual 4-41 interrupt acknowledge cycle internally, the spurious interrupt monitor generates an internal bus error signal to terminate the vector acquisition. the quicc automatically generates the spurious interrupt vector number, 24, instead of the interrupt vector number in this case. when an external device does not respond to an interrupt acknowledge cycle with avec or dsackx , a bus monitor must assert berr , which results in the cpu32+ taking the spurious interrupt vector. if halt is also asserted, the quicc retries the interrupt acknowledge cycle instead of using the spurious interrupt vector. 4.5 bus exception control cycles the bus architecture requires assertion of dsackx from an external device to signal that a bus cycle is complete. neither dsackx nor avec is asserted in the following cases: 1. dsackx in fast-termination cycles. 2. avec when programmed to respond internally. 3. the external device does not respond. 4. various other application-dependent errors occur. the quicc provides berr when no device responds by asserting dsackx /avec within an appropriate period of time after the quicc asserts as . this mechanism allows the cycle to terminate and the quicc to enter exception processing for the error condition. halt is also used for bus exception control. this signal can be asserted by an external device for debugging purposes to cause single bus cycle operation or, in combination with berr , a retry of a bus cycle in error. to properly control termination of a bus cycle for a retry or a bus error condition, dsackx , berr , and halt can be asserted and negated with the rising edge of the quicc clock. this assures that when two signals are asserted simultaneously, the required setup and hold time for both is met for the same falling edge of the quicc clock. this or an equivalent precaution should be designed into the external circuitry to pro- vide these signals. alternatively, the internal bus monitor could be used. the acceptable bus cycle terminations for asynchronous cycles are summarized in relation to dsackx assertion as follows (case numbers refer to table 4-8): 1. normal termination: dsackx is asserted; berr and halt remain negated (case 1). 2. halt termination: halt is asserted at the same time or before dsackx , and berr remains negated (case 2). 3. bus error termination: berr is asserted in lieu of, at the same time, or before dsackx (case 3) or after dsackx (case 4), and halt remains negated; berr is ne- gated at the same time or after dsackx. 4. retry termination: halt and berr are asserted in lieu of, at the same time, or before dsackx (case 5) or after dsackx (case 6); berr is negated at the same time or af- ter dsackx , and halt may be negated at the same time or after berr . table 4-8 shows various combinations of control signal sequences and the resulting bus cycle terminations. to ensure predictable operation, berr and halt should be negated according to the specifications in section 10 electrical characteristics. dsackx , berr , and halt may be negated after as . if dsackx or berr remain asserted into s2 of the next bus cycle, that cycle may be terminated prematurely.
bus operation 4-42 mc68360 user? manual motorola example a: a system uses a bus monitor timer to terminate accesses to an unpopulated address space. the timer asserts berr after timeout (case 3). example b: a system uses error detection and correction on ram contents. the designer may: 1. delay dsackx until data is verified and assert berr and halt simultaneously to in- dicate to the quicc to automatically retry the error cycle (case 5), or, if data is valid, assert dsackx (case 1). 2. delay dsackx until data is verified and assert berr with or without dsackx if data is in error (case 3). this initiates exception processing for software handling of the con- dition. 3. return dsackx prior to data verification; if data is invalid, berr is asserted on the next clock cycle (case 4). this initiates exception processing for software handling of the condition. 4. return dsackx prior to data verification; if data is invalid, assert berr and halt on the next clock cycle (case 6). the memory controller can then correct the ram prior to or during the automatic retry. notes: n ?he number of current even bus state (e.g., s2, s4, etc.) a ?ignal is asserted in this bus state na ?ignal is not asserted in this state x ?on't care s ?ignal was asserted in previous state and remains asserted in this state 4.5.1 bus errors berr can be used to abort the bus cycle and the instruction being executed. berr takes precedence over dsackx provided it meets the timing constraints described in section 10 electrical characteristics. if berr does not meet these constraints, it may cause unpredict- table 4-8. dsackx , berr , and halt assertion results case num control signal asserted on rising edge of state result n n + 2 1 dsackx berr halt a na na s na x normal cycle terminate and continue. 2 dsackx berr halt a na a/s s na s normal cycle terminate and halt; continue when halt negated. 3 dsackx berr halt na/a a na x s na terminate and take bus error exception, possibly deferred. 4 dsackx berr halt a na na x a na terminate and take bus error exception, possibly deferred. 5 dsackx berr halt na/a a a/s x s s terminate and retry when halt negated. 6 dsackx berr halt a na na x a a terminate and retry when halt negated.
bus operation motorola mc68360 user? manual 4-43 able operation of the quicc. if berr remains asserted into the next bus cycle, it may cause incorrect operation of that cycle. when berr is issued to terminate a bus cycle, the quicc may enter exception processing immediately following the bus cycle, or it may defer pro- cessing the exception. the instruction prefetch mechanism requests instruction words from the bus controller be- fore it is ready to execute them. if a bus error occurs on an instruction fetch, the quicc does not take the exception until it attempts to use that instruction word. should an intervening instruction cause a branch or should a task switch occur, the bus error exception does not occur. the bus error condition is recognized during a bus cycle in any of the following cases: 1. dsackx and halt are negated, and berr is asserted. 2. halt and berr are negated, and dsackx is asserted. berr is then asserted within one clock cycle (halt remains negated). when the quicc recognizes a bus error condition, it terminates the current bus cycle in the normal way. figure 4-29 shows the timing of a bus error for the case in which dsackx is not asserted. figure 4-30 shows the timing for a bus error that is asserted after dsackx . exceptions are taken in both cases. (refer to section 5 cpu32+ for details of bus error exception processing.) figure 4-29. bus error without dsackx clko1 s0 s2 dsackx r/w as ds berr s0 s2 sw s4 sw s4 internal processing stack write read cycle with bus error fc3?c0 d31?0 a31?0
bus operation 4-44 mc68360 user? manual motorola figure 4-30. late bus error with dsackx in the second case, in which berr is asserted after dsackx is asserted, berr must be asserted within the time specified for purely asynchronous operation, or it must be asserted and remain stable during the sample window around the next falling edge of the clock after dsackx is recognized. if berr is not stable at this time, the quicc may exhibit erratic behavior. berr has priority over dsackx . in this case, data may be present on the bus but may not be valid. this sequence can be used by systems that have memory error detection and correction logic and by external cache memories. 4.5.2 retry operation when both berr and halt are asserted by an external device during a bus cycle, the quicc enters the retry sequence shown in figure 4-31. a delayed retry, which is similar to the delayed bus error signal described previously, can also occur (see figure 4-32). the quicc terminates the bus cycle, places the control signals in their inactive state, and does not begin another bus cycle until the berr and halt signals are negated by external logic. after a synchronization delay, the quicc retries the previous cycle using the same access information (address, function code, size, etc.). berr should be negated before s2 of the retried cycle to ensure correct operation of the retried cycle. s0 s2 s4 s0 s2 s4 internal processing stack write write cycle clko1 dsackx r/w as ds berr fc3?c0 d31?0 a31?0
bus operation motorola mc68360 user? manual 4-45 figure 4-31. retry sequence the quicc retries any read or write cycle of a read-modify-write operation separately; rmc remains asserted during the entire retry sequence. asserting br at the same time as berr and halt provides a relinquish and retry opera- tion. the quicc does not relinquish the bus during a read-modify-write cycle, but may relin- quish the bus between any other bus cycles. (i.e. relinquish-and-retry has priority over bus coherency, except in the case of read-modify-write cycles). any device that requires the quicc to give up the bus and retry a bus cycle during a read-modify-write cycle must assert berr and br only (halt must not be included). the bus error handler software should examine the read-modify-write bit in the special status word (refer to section 5 cpu32+) and take the appropriate action to resolve this type of fault when it occurs. note when the relinquish and retry is asserted during an internal mas- ter's word access to an 8-bit port, and the external master that takes the bus performs an external-to-internal bus cycle, the en- s0 s2 s0 s2 sw s4 sw s4 read rerun halt read cycle with retry data ignored clko1 dsackx r/w as ds berr a31?0 fc3?c0 d31?0 halt
bus operation 4-46 mc68360 user? manual motorola tire word access will be retried. this is true even if the relinquish and retry was asserted on the second access and the first 8-bit access was completed normally. figure 4-32. late retry sequence 4.5.3 halt operation when halt is asserted and berr is not asserted, the quicc halts external bus activity at the next bus cycle boundary (see figure 4-33). halt by itself does not terminate a bus cycle. halt affects external bus cycles only; thus, a program that does not require use of the external bus may continue executing until it requires use of the external bus. negating and reasserting halt in accordance with the correct timing requirements provides a single step (bus cycle to bus cycle) operation. the single-cycle mode allows the user to proceed through (and debug) external quicc operations, one bus cycle at a time. since the occurrence of a bus error while halt is asserted causes a retry operation, the user must anticipate retry cycles while debugging in the single-cycle mode. the single-step operation and the software trace capability allow the system debugger to trace single bus cycles, sin- gle instructions, or changes in program flow. s0 s2 s4 s0 s2 s4 halt write rerun write cycle clko1 dsackx r/w as ds berr a31?0 fc3?c0 d31?10 halt
bus operation motorola mc68360 user? manual 4-47 when the quicc completes a bus cycle with halt asserted, d31?0 is placed in the high- impedance state, and bus control signals are driven inactive (not high-impedance state); the address, function code, size, and read/write signals remain in the same state. the halt oper- ation has no effect on bus arbitration (refer to 4.6 bus arbitration). when bus arbitration occurs while the quicc is halted, the address and control signals are also placed in the high-impedance state. once bus mastership is returned to the quicc, if halt is still asserted, the address, function code, size, and read/write signals are again driven to their previous states. the quicc does not service interrupt requests while it is halted. notes in figure 4-33, note that br is not asserted until after the halt op- eration is complete. if br is asserted at the same time as halt , the user should note that the bg signal may not be asserted im- mediately (as in other m68000 family devices) but rather after the full operand transfer is complete. this difference in behavior is due to the coherency rules imposed by the quicc and other imb-based m68300 family members. refer to 4.6 bus arbitra- tion for more details. to override the coherency rules, a relin- quish and retry cycle may be used. in the mcr of the sim60, if the show cycles enable bits shen1- shen0 = 1x to enable show cycles mode, and halt is asserted externally, the following behavior is possible. it is possible that the quicc may not show the last bus cycle externally, if that bus cycle happens to be an internal-to-internal bus cycle. this is due to a pipelining characteristic of the quicc coupled with the halt signal being asserted late into an internal-to-external bus cycle. note that show cycles mode is not the normal configura- tion for the quicc.
bus operation 4-48 mc68360 user? manual motorola figure 4-33. halt timing 4.5.4 double bus fault a double bus fault results when a bus error or an address error occurs during the exception processing sequence for any of the following: 1. a previous bus error 2. a previous address error 3. a reset for example, the quicc attempts to stack several words containing information about the state of the machine while processing a bus error exception. if a bus error exception occurs during the stacking operation, the second error is considered a double bus fault. when a double bus fault occurs, the quicc halts and drives the halt line low. only a reset opera- tion can restart a halted quicc. however, bus arbitration can still occur (refer to 4.6 bus arbitration). a second bus error or address error that occurs after exception processing has clko1 s0 s2 s4 r/w as ds halt s0 s2 s4 br bg bgack s0 read halt (arbitration permitted while the processor is halted) read dsackx a31?0 fc3?c0 d31?0
bus operation motorola mc68360 user? manual 4-49 completed (during execution of the exception handler routine or later) does not cause a dou- ble bus fault. a bus cycle that is retried does not constitute a bus error or contribute to a dou- ble bus fault. the quicc continues to retry the same bus cycle as long as the external hardware requests it. reset can also be generated internally by the halt monitor (see section 5 cpu32+). 4.6 bus arbitration the bus design of the quicc provides for a single bus master at any one time, either the quicc or an external device. one or more of the external devices on the bus can have the capability of becoming bus master for the external bus and the quicc internal bus. bus arbitration is the protocol by which an external device becomes bus master; the bus control- ler in the quicc manages the bus arbitration signals so that the quicc has the lowest pri- ority. note the quicc may assert the bclro signal for one or more of its internal bus masters, idma, sdma, or dram refresh cycle, or when an interrupt request is pending on a level that is greater than a programmable level. the user can use bclro to negate the br line asserted by an external master to reduce the inter- rupt latency for programmable interrupt levels and to increase the quicc internal master arbitration priority over external mas- ters. external devices that need to obtain the bus must assert the bus arbitration signals in the sequences described in the following paragraphs. systems that include several devices that can become bus master require external circuitry to assign priorities to the devices, so that when two or more external devices attempt to become bus master at the same time, the one having the highest priority becomes bus master first. the sequence of the protocol is as fol- lows: 1. an external device asserts br . 2. the quicc asserts bg to indicate that the bus is available. 3. the external device asserts bgack to indicate that it has assumed bus mastership. br may be issued any time during a bus cycle or between cycles. bg is asserted in response to br . to guarantee operand coherency, bg is only asserted at the end of an operand transfer. (for example if any internal master such as the cpu, sdma or idma on the quicc is writing a 32-bit operand to an 8-bit port size, bg is not asserted until the fourth byte is written.) additionally, bg is not asserted until the end of a read-modify-write opera- tion (when rmc is negated) in response to a br signal. when the requesting device receives bg and more than one external device can be bus master, the requesting device should begin whatever arbitration is required. when it assumes bus mastership, the external device asserts bgack and maintains bgack during the entire bus cycle (or cycles) for which it is bus master. the following conditions must be met for an external device to assume mastership of the bus through the normal bus arbitration procedure: it must have
bus operation 4-50 mc68360 user? manual motorola received bg through the arbitration process, and bgack must be inactive, indicating that no other bus master has claimed ownership of the bus. figure 4-34 is a flowchart showing the detail involved in bus arbitration for a single device. this technique allows processing of bus requests during data transfer cycles. figure 4-34. bus arbitration flowchart for single request the quicc has a synchronous arbitration timing mode to reduce the br to bg delay to one clock in the idle bus case (see figure 4-35). figure 4-36 illustrates the active bus case. br is negated at the time that bgack is asserted. this type of operation applies to a system consisting of the quicc and one device capable of bus mastership. in a system having a number of devices capable of bus mastership, br from each device can be wire-ored to the quicc. in such a system, more than one bus request could be asserted simultaneously. bg is negated a few clock cycles after the transition of bgack . however, if bus requests are still pending after the negation of bg , the quicc asserts another bg within a few clock cycles after it was negated. this additional assertion of bg allows external arbitration cir- cuitry to select the next bus master before the current bus master has finished using the bus. the following paragraphs provide additional information about the three steps in the arbitra- tion process. bus arbitration requests are recognized during normal processing, halt assertion, and when the cpu32+ has halted due to a double bus fault. grant bus arbitration 1) assert bg terminate arbitration 1) negate bg (and wait for bgack to be negated) re-arbitrate or resume processor operation quicc requesting device request the bus 1) assert br acknowledge bus mastership 1) external arbitration determines next bus master 2) next bus master waits for bgack to be negated 3) next bus master asserts bgack to become new master 4) bus master negates br operate as bus master release bus mastership 1) negate bgack 1) perform data transfers (read and write cycles) according to the same rules the processor uses
bus operation motorola mc68360 user? manual 4-51 figure 4-35. bus arbitration timing diagram?dle bus case a31?0 as ds dsack1?sack0 br bg bgack d31?0 br has synchronous timing. br has asynchronous timing. note: clko1
bus operation 4-52 mc68360 user? manual motorola figure 4-36. bus arbitration timing diagram?ctive bus case 4.6.1 bus request external devices capable of becoming bus masters request the bus by asserting br . this signal can be wire-ored to indicate to the quicc that some external device requires control of the bus. the quicc is effectively at a lower bus priority level than the external device and relinquishes the bus after it has completed the current bus cycle (if one has started). if no bgack is received while the br is active, the quicc remains bus master once br is negated. this prevents unnecessary interference with ordinary processing if the arbitration circuitry inadvertently responds to noise or if an external device determines that it no longer requires use of the bus before it has been granted mastership. a31?0 as ds dsack1?sack0 br (in) bg (out) bgack (in) d31?0 br has synchronous timing . br has synchronous timing. s0 s2 s3 s4 s1 s5 r/w note: clko1
bus operation motorola mc68360 user? manual 4-53 4.6.2 bus grant the quicc supports operand coherency; thus, if an operand transfer requires multiple bus cycles, the quicc does not release the bus until the entire transfer is complete. the asser- tion of bg is therefore subject to the following constraints: the minimum time for bg assertion after br is asserted depends on internal synchro- nization. when working in synchronous mode (astm bit in the mcr is set), the minimum time can be one clock. during an external operand transfer, the quicc does not assert bg until after the last cycle of the transfer (determined by sizx and dsackx ). during an external operand transfer, the quicc does not assert bg as long as rmc is asserted. if the show cycle bits shen1?hen0 = 1x and if one of the quicc internal masters is making internal accesses, the quicc does not assert bg until the transfer is terminat- ed. if shen1?hen0 = 00 and if one of the quicc internal masters is making internal ac- cesses, the external bus is granted away, and the quicc continues to execute internal bus cycles. in this case, the arbitration overhead (external bus idle time) is minimal. if shen1?hen0 = 01, the quicc does not assert bg to an external master. externally, the bg signal can be routed through a daisy-chained network or a priority- encoded network. the quicc is not affected by the method of arbitration as long as the pro- tocol is obeyed. 4.6.3 bus grant acknowledge an external device cannot request and be granted the external bus while another device is the active bus master. a device that asserts bgack remains the bus master until it negates bgack . bgack should not be negated until all required bus cycles are completed. bus mastership is terminated at the negation of bgack . when no other device requests the bus after bgack is negated, the quicc will regain bus mastership. the minimum time for the first bus cycle after bgack negation depends on internal syn- chronization and internal bus arbitration. this timing is therefore subject to the following con- straints: when working in synchronous mode (astm bit in the mcr is set) and shen0?hen1 = 00 and one of the quicc internal masters requests an external accesses, the mini- mum time can be one clock. when working in asynchronous mode (astm bit in the mcr is cleared) and shen0? = 00 and one of the quicc internal masters requests an external accesses, the mini- mum time depends on internal synchronization plus one clock. if shen1?hen0 = 1 , another clock is added for internal bus arbitration.
bus operation 4-54 mc68360 user? manual motorola once an external device receives the bus and asserts bgack , it should negate br . if br remains asserted after bgack is asserted, the quicc assumes that another device is requesting the bus and prepares to issue another bg . 4.6.4 bus arbitration control the bus arbitration control unit in the quicc is implemented with a finite state machine. as discussed previously, all asynchronous inputs to the quicc are internally synchronized in a maximum of two cycles of the clock. as shown in figure 4-37, input signals labeled r and a are internally synchronized versions of br and bgack, respectively. the bg output is labeled g, and the internal high-impedance control signal is labeled t. if t is true, the address, data, and control buses are placed in the high-impedance state after the next rising edge following the negation of as and rmc . all signals are shown in positive logic (active high), regardless of their true active voltage level. the state machine shown in figure 4-37 does not have a state 1 or state 4. state changes occur on the next rising edge of the clock after the internal signal is valid. the bg signal transitions on the rising edge of the clock after a state is reached during which g changes. the bus control signals (controlled by t) are driven by the quicc immediately fol- lowing a state change, when bus mastership is returned to the quicc. state 0, in which g and t are both negated, is the state of the bus arbiter while the quicc is bus master. r and a keep the arbiter in state 0 as long as they are both negated. the quicc does not allow arbitration of the external bus during the rmc sequence. for the duration of this sequence, the quicc ignores the br input. if mastership of the bus is required during an rmc operation, berr must be used to abort the rmc sequence.
bus operation motorola mc68360 user? manual 4-55 figure 4-37. bus arbitration state diagram 4.6.5 slave (disable cpu32+) mode bus arbitration when configured in the slave mode, the quicc follows the bus arbitration mechanism de- scribed in 4.6 bus arbitration. when acting as one or more of the quicc internal masters (refresh cycles, idma, and sdma), the quicc will output the br signal. systems that in- clude several devices that can become bus master require external circuitry to assign prior- ities to the devices, so that when two or more external devices attempt to become bus r state 5 gtv state 3 v g t state 2 v g t state 0 v g t state 6 gtv ra b ra ab r a b + r a r ra + ra ra a + r?us request a?us grant acknowledge b?us cycle in progress g?us grant t ?hree-state signal to bus control v?us available to bus control r a r a r a
bus operation 4-56 mc68360 user? manual motorola master at the same time, the one having the highest priority becomes bus master first. the sequence of the protocol in normal slave mode is as follows: 1. the quicc asserts br . 2. the quicc waits for the assertion of bg and the negation of bgack to indicate that the bus is available. 3. the quicc asserts bgack to indicate that it has assumed the bus. the state machine for the normal slave mode arbitration is shown in figure 4-38. figure 4-38. slave mode bus arbitration state machine in 68040 companion mode, the quicc changes its bus arbitration sequence to match that needed by the 68040. it is as follows: 1. the quicc asserts bg continuously whenever the quicc does not need the bus. 2. when the quicc needs the bus, and the 68040 is not requesting the bus, it will deas- sert bg from the 68040 and assert bb to indicate that it has assumed the bus. if the 68040 then requests the bus using the br pin, while the quicc is asserting bb , the br040id bits in the mcr will be used to determine if the 68040 has a high enough bus request priority to cause the quicc to give up the bus (i.e. deassert bb and assert bg .) idle quicc waiting for bus quicc owns bus br negated br asserted external bus idle quicc requires external bus note: bgack is only asserted by quicc during the state "quicc owns bus", otherwise bgack is three-stated by the quicc. bg = 1 bg = 0 br negated bgack asserted quicc still needs bus halt is asserted and dram refresh does not require external bus quicc no longer needs bus or halt asserted and dram refresh does not need bus external master access to dual port ram
bus operation motorola mc68360 user? manual 4-57 3. if the 68040 requests the bus at the same time that a quicc internal master is re- questing the bus, the br040id bits are used to determine who will acquire the bus first. 4. when the quicc no longer needs the bus, it deasserts bb and asserts bg . the state machine for the mc68040 companion mode arbitration is shown in figure 4-39. figure 4-39. mc68040 companion mode bus arbitration state machine idle quicc waiting for bus bg asserted quicc internal master of higher priority than the 68040 requires external bus bg negated halt is asserted and dram refresh does not require external bus external bus idle 040 owns bus bg asserted 040 requests bus 040 finishes use of bus internal master (idma, sdma, or dram refresh) requests bus notes: 1. if the 68040 and the quicc internal master requests the bus at the same time, the highest priority requester wins. 2. the transition from "040 owns bus" to "quicc waiting for bus" may be delayed, until the write portion of an 040 locked cycle if an 040 locked cycle is in progress when the higher priority quicc internal master requests the bus. 3. bb is only asserted by quicc during the state "quicc owns bus", otherwise bb is three-stated by the quicc. bb = 0 bb = 1 bg negated bb asserted 040 still needs bus quicc still needs bus quicc no longer needs bus or halt asserted and dram refresh does not need bus br is asserted by 040 and 040 has priority over current quicc internal bus master quicc owns bus
bus operation 4-58 mc68360 user? manual motorola the quicc has another mechanism to assign priorities to the bus masters. a new pin called bus clear in (bclri) is defined. bclri indicates to the quicc that a request is being made for the quicc to release the system bus. the quicc will then clear all internal bus masters with an arbitration id smaller than the programmed value of the bus clear in id (bclriid) in the mcr. slave (disable cpu32+) mode bus arbitration has fewer arbitration modes than exist in a normal mode, since in slave mode, the shen1-shen0 bits are forced to be "00": in synchronous mode (astm bit in the mcr is set), bg and bgack have synchronous timing, and the minimal delay between the assertion of bg (negation of bgack ) and the assertion of bgack is one clock. in asynchronous mode, the minimum time for bgack assertion after bg is asserted (bgack is negated) depends on internal synchronization. the quicc will not request the external bus (assert br ) when one of its internal mas- ters is making an internal access. the quicc will request the external bus only when one of its internal masters is beginning an external access. in this case, the arbitration overhead (external bus idle time is minimal). see figure 4-40 for the slave mode bus arbitration timing diagram. figure 4-40. slave mode bus arbitration timing diagram br (out) bg (in) bgack (in/out) s0 s2 s3 s4 s1 s5 a31?0 as ds dsack1-dsack0 d31?0 r/w 1. synchronous arbitration with shen1?hen0 = 00. 2. minimum bus idle time. notes: clko1
bus operation motorola mc68360 user? manual 4-59 4.6.6 slave (disable cpu32+) mode bus exceptions the reset and bus error master mode support also applies to the slave mode. there is a difference, however, in supporting halt and retry as explained in the following paragraphs. 4.6.6.1 halt . the quicc transfer operation may be suspended at any time by asserting halt to the quicc. in response, any bus cycle in progress is completed (after dsackx is asserted), and bus ownership is released. no further bus cycles will be started while halt remains asserted. when the quicc is in the middle of an operand transfer when halted and when a new transfer request is pending, the quicc will arbitrate for the bus and continue normal operation. note when the quicc is doing a word access to an 8-bit port and halt is asserted during the first access to an 8-bit port, the quicc will access this byte again after bus ownership is granted to the quicc. note in slave mode halt has more priority than bus coherency, whereas in normal mode (cpu32+ is enabled) halt has less priority than bus coherency. 4.6.6.2 retry. when halt and berr are asserted during a bus cycle, the quicc termi- nates the bus cycle, releases the bus, and suspends any further operation until these signals are negated. the quicc will then arbitrate for the bus, re-execute the previous bus cycle, and continue normal operation. thus, in slave mode, a retry is actually a relinquish and retry. note when the relinquish and retry is asserted during a word access to an 8-bit port, and the external master that takes the bus per- forms an external-to-internal bus cycle, the entire word access will be retried. this is true even if the relinquish and retry was asserted on the second access and the first 8-bit access was completed normally. 4.6.7 internal accesses the quicc supports an external-master access to its internal registers with a glueless inter- face. the quicc internal register port size is always 32 bits. external quicc/mc68ec030 accesses have the same bus operation as the quicc (see 4.3 data transfer cycles ) . the quicc supports the interrupt acknowledge cycles presented in 4.4.4 interrupt acknowledge bus cycles. the quicc also supports the mc68ec040 read and write accesses and inter- rupt acknowledge cycles (see figure 4-41?igure 4-44).
bus operation 4-60 mc68360 user? manual motorola figure 4-41. mc68ec040 internal registers read cycle figure 4-42. mc68ec040 internal registers write cycle c1 a31?0 d31?0 siz1?iz0 tt1?t0 tm2?m0 c2 r/ w ts ta cw cw cw tbi clko1 c1 a31?0 d31?0 siz1?iz0 tt1?t0 tm2?t0 c2 r/w ts ta cw cw cw tbi clko1
bus operation motorola mc68360 user? manual 4-61 figure 4-43. mc68ec040 autovector operation timing figure 4-44. mc68ec040 interrupt acknowledge cycle c1 a31?0 d31?0 siz1?iz0 tt1?t0 tm2?m0 c2 r/w ts ta cw cw cw tbi interrupt level internal arbitration cw cw iack7 iack1 aveco clko1 c1 a31?0 siz1?iz0 tt1?t0 d31?8 tm2?m0 c2 r/w ts ta cw cw cw tbi interrupt level internal arbitrati0n d7?0 cw cw iack7 iack1 vector# clko1
bus operation 4-62 mc68360 user? manual motorola 4.6.8 show cycles the quicc can perform data transfers with its internal modules without using the external bus, but when debugging, it is desirable to have address and data information appear on the external bus. these external bus cycles, called show cycles, are distinguished by the fact that as is not asserted externally. ds is used to signal address strobe timing in show cycles. after reset, show cycles are disabled and must be enabled by writing to the shen bits in the module configuration register. when show cycles are disabled, the address bus, function codes, size, and read/write signals continue to reflect internal bus activity. however, as and ds are not asserted externally, and the external data bus remains in a high impedance state. when show cycles are enabled, ds indicates address strobe timing and the external data bus contains data. the following paragraphs are a state-by-state description of show cycles, and figure 4-45 illustrates a show cycle timing diagram. refer to section 10 electri- cal characteristics for specific timing information. state 0 ?during state 0, the address and function codes become valid, r/w is driven to indi- cate a show read or write cycle, and the size pins indicate the number of bytes to transfer. during a read, the addressed peripheral is driving the data bus, and the user must take care to avoid bus conflicts. state 41 ?one-half clock cycle later, ds (rather than as ) is asserted to indicate that address information is valid. state 42?no action occurs in state 42. the bus controller remains in state 42 (wait states will be inserted) until the internal read cycle is complete. state 43?when ds is negated, show data is valid on the next falling edge of the system clock. the external data bus drivers are enabled so that data becomes valid on the external bus as soon as it is available on the internal bus. state 0 ?the address, function codes, read/write, and size pins change to begin the next cycle. data from the preceding cycle is valid through state 0.
bus operation motorola mc68360 user? manual 4-63 figure 4-45. show cycle timing diagram 4.7 reset operation the quicc has reset control logic to determine the cause of reset, synchronize it if neces- sary, and assert the appropriate reset lines. the reset control logic can independently drive five different internal lines: 1. extsysrst (external system reset) drives the external hard and soft reset pins (re- seth and resets) . 2. extrst (external reset) drives the external soft reset pin (resets ). 3. clkrst (clock reset) resets the clock module. 4. intsysrst (internal system reset) resets the memory controller, system protection logic, serial interface, interrupt controller, and parallel i/o modules. 5. intrst (internal reset) goes to all other internal circuits. table 4-9 summarizes the result of each reset source. synchronous reset sources are not asserted until the end of the current bus cycle, regardless of whether rmc is asserted. the internal bus monitor is automatically enabled for synchronous resets; therefore, if the current bus cycle does not terminate normally, the bus monitor terminates it. only single-byte or word transfers are guaranteed valid for synchronous resets. asynchronous reset sources indicate a catastrophic failure, and the reset controller logic immediately resets the system. resetting the quicc causes any bus cycle in progress to terminate as if dsackx or berr had been asserted. in addition, the quicc appropriately initializes registers for a reset exception. a31?0 fc3?c0 siz1?iz0 clko1 s0 s42 s1 s41 s43 s2 s0 r/w as, cs ds d31?0 bkpt show cycle start of external cycle
bus operation 4-64 mc68360 user? manual motorola notes: 1.the reset behavior is this case is dependent on the pll programming (see 6.9.3.9 clko control register (clkocr)). 2.doesn't cause a cpu32 reset exception nor does it affect any of its internal registers. if an external device drives resets or reseth low, they should be asserted for at least 32 clock periods to ensure that the quicc resets. when the reset control logic detects that an external device drives resets low, it starts driving both internal and external resets low for 512 cycles to guarantee this length of reset to the entire system. when the reset con- trol logic detects that an external device drives reseth low, it starts driving both internal and external resets and reseth low for 512 cycles to guarantee this length of reset to the entire system. the external and the internal resets are released after the external device stops driving the external reset signal low or after the 512 cycles, whatever is later. figure 4-46 shows the reset timing. figure 4-46. timing for external devices driving reset note resets signal will always be negated after 512 cycles after as- sertion. if reset is asserted from any other source, the reset control logic asserts a reset for a mini- mum of 512 cycles and until the source of reset is negated. after any internal reset occurs, a 14-cycle rise time is allowed before testing for the presence of an external reset. if no external reset is detected, the cpu32+ begins its vector fetch. figure 4-47 is a timing diagram of the power-up reset operation, showing the relationships between reseth , resets , vcc, and bus signals. during the reset period, the entire bus three-states (except for non-three-statable signals, which are driven to their inactive state). table 4-9. reset source summary type source timing reset lines asserted by controller external hard reset (reseth ) external asynchronous intrst intsysrst clkrst extsysrst external soft reset (resets ) external synchronous intrst extrst power-up ebi asynchronous intrst intsysrst clkrst extsysrst software watchdog sys prot asynchronous intrst intsysrst extsysrst double bus fault sys prot asynchronous intrst intsysrst clkrst extsysrst loss of clock 1 clock asynchronous intrst intsysrst clkrst extsysrst reset instruction cpu32+ asynchronous intrst 2 extrst pulled external resets or reseth t 32 clks t 14 clks 512 cycles 3
bus operation motorola mc68360 user? manual 4-65 once reseth and resets negate, all control signals are driven to their inactive state, the data bus is in read mode, and the address bus is driven. after this, the first bus cycle of the reset exception processing begins. figure 4-47. initial reset operation timing note the pll samples the modclk pins while in the first 512 clocks of reset. the process starts with reset being asserted, then modclk pins are sampled and the pll is initialized according to the modclk pins. for the next 500-2000 extal cycles the pll is synchronizing. 512 clocks after the pll synchronizes, the quicc no longer drives reset and does not sample the mod- clk pins. user should make suer the ramp up time of vcc will never be faster than 4msec to ensure proper power on reset sequence. when a reset instruction is executed, the quicc drives the resets signal for 512 clock cycles. in this case, the quicc resets the external devices of the system, and many of the internal registers of the quicc (see section 3 quicc memory map for a list of registers affected by each type of reset). the bus arbitration circuitry is only reset during a power-on reset. it may be used during all other resets. in quicc slave mode (disable cpu32+) the reset operates the same as in the normal (mas- ter) mode except that the reset instruction does not exist. clko1 vco lock bus c ycles r eseth v cc 1 23 4 bus state unknown address and control signals three-stated 512 clkout 14 clocks notes: 1. internal start-up time. 2. ssp read here. 3. pc read here. 4. first instruction fetched here. 5. this figure is true when modck is 11 or 10. when modck is 01 clko1 will be driven high at power up.
bus operation 4-66 mc68360 user? manual motorola note resets does not restore the boot cs0 since the intent of re- sets is to not reset the memory controller. note that the cpu will still fetch the sp and pc from $0 and $4, therefore a system implementing resets must have a device or register mapped to 0 and 4 at all times. in the case where the cp32+ excutes a reset command, the quicc drives resets pin. in that case resets will be driven from clock low (not clock high as in all other cases). this requires a special ac timing parameter which is spec 58a in 10.9 bus operation ac timing specifications.
motorola mc68360 user? manual 5-1 section 5 cpu32+ the cpu32+, the second instruction processing module of the m68300 family, is based on the industry-standard mc68000 core processor. like the original cpu32, it has many fea- tures of the mc68010 and mc68020 as well as unique features suited for high-performance processor applications. the cpu32+ provides a significant performance increase over the mc68000 cpu, yet maintains source-code and binary-code compatibility with the m68000 family. the cpu32+ differs from the original cpu32 in two ways: it allows an option of a 32-bit data interface and allows byte-misaligned accesses to data operands. 5.1 overview the cpu32+ is designed to interface to the intermodule bus (imb), allowing interaction with other imb submodules. in this manner, integrated processors can be developed that contain useful peripherals on chip. this integration provides high-speed accesses among the imb submodules, increasing system performance. the cpu32+ core is a cpu32 core with its bus interface unit modified to connect directly to the 32-bit imb and take advantage of the larger bus width. although the original cpu32 core already had a 32-bit internal data path and 32-bit arithmetic hardware, its external interface (i.e., to the internal imb) was 16 bits. the cpu32+ core, however, can operate on 32-bit external operands with one bus cycle. this capability allows the cpu32+ core to fetch a long-word instruction or two word-length instructions in one bus cycle, allowing the internal instruction queue to be filled more quickly. the cpu32+ core can also read and write 32- bits of data in one bus cycle. the cpu32+ has an additional word in its instruction pipeline when fetching from a 32-bit port. when fetching from a 16-bit port, this additional word is disabled. the performance of the cpu32+ on a 16-bit bus is the same as the cpu32 per- formance. the cpu32+ also supports byte-misaligned operands. since operands can reside at any byte boundary, they may occasionally become misaligned. a byte operand is properly aligned at any address; a word operand is misaligned at a odd address; a long-word oper- and is misaligned at an address that is not evenly divisible by four. devices such as the mc68302, mc68000/8, mc68010, and cpu32-based mc68300 allow long-word operand transfers at odd-word addresses, but force exceptions if word or long-word operand trans- fers are attempted at odd-byte addresses. although the cpu32+ does not enforce any align- ment restrictions for data operands (including pc relative data addresses), some performance degradation occurs when additional bus cycles are required for long-word or word operands that are misaligned. for maximum performance, data items should be thi d t t d ith f m k 4 0 4
cpu32+ 5-2 mc68360 user? manual motorola aligned on their natural boundaries. all instruction words and extension words must reside on word boundaries. attempting to prefetch an instruction word at an odd address causes an address error exception. the cpu32+ has four bits (sz1, sz0 and szc1, scz0) in the software status word (ssw) that are new or have changed definitions. the cpu32+ offers low power consumption. the cpu32+ is implemented in high-speed complementary metal-oxide semiconductor (hcmos) technology, providing low power use during normal operation. during periods of inactivity, the low-power stop (lpstop) instruc- tion can be executed, shutting down the cpu32+ and other imb modules, greatly reducing power consumption. ease of programming is an important consideration when using an integrated processor. the cpu32+ instruction format reflects a predominant register-memory interaction philoso- phy. all data resources are available to operations that require them. the programming model includes eight multifunction data registers and seven general-purpose addressing registers. the data registers support 8-bit (byte), 16-bit (word), and 32-bit (long-word) oper- and lengths for all operations. address manipulation is supported by word and long-word operations. although the program counter (pc) and stack pointers (sp) are special-purpose registers, they are also available for most data addressing activities. ease of program check- ing and diagnosis is enhanced by trace and trap capabilities at the instruction level. as processor applications become more complex and programs become larger, high-level languages (hlls) become the system designer's choice in programming languages. hlls aid in the rapid development of complex algorithms with less error and are readily portable. the cpu32+ instruction set efficiently support hlls. 5.1.1 features features of the cpu32+ are as follows: fully upward object-code compatible with m68000 family loop mode of instruction execution fast multiply, divide, and shift instructions fast bus interface with dynamic bus port sizing improved exception handling additional addressing modes ?caled index ?ddress register indirect with base displacement and index ?xpanded pc relative modes ?2-bit branch displacements instruction set additions ?igh-precision multiply and divide ?rap on condition codes ?pper and lower bounds checking
cpu32+ motorola mc68360 user? manual 5-3 enhanced breakpoint instruction trace on change of flow table lookup and interpolate (tbl) instruction lpstop instruction hardware bkpt signal, background mode fully static implementation a block diagram of the cpu32+ is shown in figure 5-1. the major blocks depicted operate in a highly independent fashion that maximizes concurrences of operation while managing the essential synchronization of instruction execution and bus operation. the bus controller loads instructions from the data bus into the decode unit. the sequencer and control unit provide overall chip control by managing the internal buses, registers, and functions of the execution unit. figure 5-1. cpu32+ block diagram 5.1.2 loop mode instruction execution the cpu32+ has several features that provide efficient execution of program loops. one of these features is the dbcc looping primitive instruction. to increase the performance of the cpu32+, a loop mode has been added to the processor. the loop mode is used by any sin- gle-word instruction that does not change the program flow. loop mode is implemented in conjunction with the dbcc instruction. figure 5-2 shows the required form of an instruction loop for the processor to enter loop mode. the loop mode is entered when the dbcc instruction is executed and the loop displacement is ?. once in loop mode, the processor performs only the data cycles associated with the instruction and suppresses all instruction fetches. the termination condition and count are checked after each execution of the data operations of the looped instruction. the cpu32+ automatically exits the loop mode during interrupts or other exceptions. bus control instruction prefetch and decode execution unit sequencer control unit bus control address bus data bus 16 32
cpu32+ 5-4 mc68360 user? manual motorola figure 5-2. loop mode instruction sequence 5.1.3 vector base register the vector base register (vbr) contains the base address of the 1024-byte exception vector table, which consists of 256 exception vectors. exception vectors contain the memory addresses of routines that begin execution at the completion of exception processing. these routines perform a series of operations appropriate for the corresponding exceptions. because the exception vectors contain memory addresses, each vector consists of one long word, except the reset vector. the reset vector consists of two long words: the address used to initialize the supervisor stack pointer (ssp) and the address used to initialize the pc. the address of an interrupt exception vector is derived from an 8-bit vector number and the vbr. the vector numbers for some exceptions are obtained from an external device; other numbers are supplied automatically by the processor. the processor multiplies the vector number by 4 to calculate the vector offset, which is added to the vbr. the sum is the mem- ory address of the vector. all exception vectors are located in supervisor data space, except the reset vector, which is located in supervisor program space. only the initial reset vector is fixed in the processor's memory map; once initialization is complete, there are no fixed assignments. since the vbr provides the base address of the vector table, the vector table can be located anywhere in memory; it can even be dynamically relocated for each task that is executed by an operating system. refer to 5.5 exception processing for additional details. 5.1.4 exception handling the processing of an exception occurs in four steps, with variations for different exception causes. during the first step, a temporary internal copy of the status register (sr) is made, and the sr is set for exception processing. during the second step, the exception vector is determined. during the third step, the current processor context is saved. during the fourth step, a new context is obtained, and the processor then proceeds with instruction process- ing. exception processing saves the most volatile portion of the current context by pushing it on the supervisor stack. this context is organized in a format called the exception stack frame. this information always includes the sr and pc context of the processor when the excep- tion occurred. to support generic handlers, the processor places the vector offset in the exception stack frame. the processor also marks the frame with a frame format. the format 31 0 vector base register (vbr) one-word instruction dbcc dbcc displacement $fffc = 4
cpu32+ motorola mc68360 user? manual 5-5 field allows the return-from-exception (rte) instruction to identify what information is on the stack so that it may be properly restored. 5.1.5 addressing modes addressing in the cpu32+ is register oriented. most instructions allow the results of the specified operation to be placed either in a register or directly in memory; this flexibility elim- inates the need for extra instructions to store register contents in memory. the seven basic addressing modes are as follows: register direct register indirect register indirect with index program counter indirect with displacement program counter indirect with index absolute immediate included in the register indirect addressing modes are the capabilities to postincrement, pre- decrement, and offset. the pc relative mode also has index and offset capabilities. in addi- tion to these addressing modes, many instructions implicitly specify the use of the sr, sp and/or pc. addressing is explained fully in the m68000pm/ad, m68000 family program- mer? reference manual . 5.2 architecture summary the cpu32+ is upward source- and object-code compatible with the mc68000 and mc68010. it is downward source- and object-code compatible with the mc68020. within the m68000 family, architectural differences are limited to the supervisory operating state. user programs can be executed unchanged on upward-compatible devices. the major cpu32+ features are as follows: 32-bit internal data path and arithmetic hardware 32-bit address bus supported by 32-bit calculations rich instruction set eight 32-bit general-purpose data registers seven 32-bit general-purpose address registers separate user and supervisor stack pointers (usp and ssp) separate user and supervisor address spaces separate program and data address spaces many data types flexible addressing modes full interrupt processing expansion capability
cpu32+ 5-6 mc68360 user? manual motorola 5.2.1 programming model the cpu32+ programming model consists of two groups of registers that correspond to the user and supervisor privilege levels. user programs can only use the registers of the user model. the supervisor programming model, which supplements the user programming model, is used by cpu32+ system programmers who wish to protect sensitive operating system functions. the supervisor model is identical to that of mc68010 and later proces- sors. the cpu32+ has eight 32-bit data registers, seven 32-bit address registers, a 32-bit pc, separate 32-bit ssp and usp, a 16-bit sr, two alternate function code registers, and a 32- bit vbr (see figure 5-3 and figure 5-4). figure 5-3. user programming model 31 16 15 0 d0 d1 d2 d3 d4 d5 d6 d7 data registers 31 16 15 8 7 0 a0 a1 a2 a3 a4 a5 a6 address registers 31 16 15 87 0 a7 (usp) pc ccr user stack pointer program counter condition code register 31 0 15 0
cpu32+ motorola mc68360 user? manual 5-7 figure 5-4. supervisor programming model supplement 5.2.2 registers registers d7?0 are used as data registers for bit, byte (8-bit), word (16-bit), long-word (32- bit), and quad-word (64-bit) operations. registers a6 to a0 and the usp and ssp are address registers that may be used as software sps or base address registers. register a7 (shown as a7 and a7' in figure 5-3 and figure 5-4) is a register designation that applies to the usp in the user privilege level and to the ssp in the supervisor privilege level. in addi- tion, address registers may be used for word and long-word operations. all 16 general-pur- pose registers (d7?0, a7?0) may be used as index registers. the program counter (pc) contains the address of the next instruction to be executed by the cpu32+. during instruction execution and exception processing, the processor auto- matically increments the contents of the pc or places a new value in the pc, as appropriate. the status register (sr) (see figure 5-5) contains condition codes, an interrupt priority mask (three bits), and three control bits. condition codes reflect the results of a previous operation. the codes are contained in the low byte (ccr) of the sr. the interrupt priority mask determines the level of priority an interrupt must have to be acknowledged. the control bits determine trace mode and privilege level. at user privilege level, only the ccr is avail- able. at supervisor privilege level, software can access the full sr. the vector base register (vbr) contains the base address of the exception vector table in memory. the displacement of an exception vector is added to the value in this register to access the vector table. alternate source and destination function code registers (sfc and dfc) contain 3-bit func- tion codes. the cpu32+ generates a function code each time it accesses an address. spe- cific codes are assigned to each type of access. the codes can be used to select eight dedicated 4-gbyte address spaces. the movec instruction can use registers sfc and dfc to specify the function code of a memory address. 31 16 15 87 0 a7 (ssp) sr vbr supervisor stack pointer status register vector base register 0 alternate function code registers (ccr) 2 0 0 sfc dfc 3 31 31
cpu32+ 5-8 mc68360 user? manual motorola figure 5-5. status register 5.3 instruction set the following paragaphs describe the cpu32+ instruction set. a description of the instruc- tion format, the operands used by the instructions, and a summary of the instructions by cat- egory are included. complete programming information is provided in the m68000pm/ad, m68000 family programmer? reference manual. the cpu32+ instructions include machine functions for all the following operations: data movement arithmetic operations logical operations shifts and rotates bit manipulation conditionals and branches system control the large instruction set encompasses a complete range of capabilities and, combined with the enhanced addressing modes, provides a flexible base for program development. the instruction set of the cpu32+ is very similar to that of the mc68020 (see table 5-1). the following m68020 instructions are not implemented on the cpu32+: bfxx bit field instructions (bfchg, bfclr, bfexts, bfextu, bfffo, bfins, bfset, bftst) callm, rtm call module, return module cas, cas2 compare and set (read-modify-write instructions) cpxxx coprocessor instructions (cpbcc, cpdbcc, cpgen, cprestore, cpsave, cpscc, cptrapcc) pack, unpk pack, unpack bcd instructions the cpu32+ traps on unimplemented instructions or illegal effective addressing modes, allowing user-supplied code to emulate unimplemented capabilities or to define special-pur- pose functions. however, motorola reserves the right to use all currently unimplemented instruction operation codes for future m68000 core enhancements. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 t1 t0 s 0 0 i2 i1 i0 0 0 0 x n z v c extend negative zero overflow carry interrupt priority mask supervisor/user state trace enable system byte user byte (condition code register)
cpu32+ motorola mc68360 user? manual 5-9 table 5-1. instruction set mnemonic description mnemonic description abcd add decimal with extend movea move address add add move ccr move condition code register adda add address move sr move to/from status register addi add immediate move usp move user stack pointer addq add quick movec move control register and logical and movem move multiple registers andi logical and immediate movep move peripheral data asl arithmetic shift left moveq move quick asr arithmetic shift right moves move alternate address space bcc branch conditionally (16 tests) muls signed multiply bchg bit test and change mulu unsigned multiply bclr bit test and clear nbcd negate decimal with extend bgnd enter background mode neg negate bkpt breakpoint negx negate with extend bra branch always nop no operation bset bit test and set not ones complement bsr branch to subroutine or logical inclusive or btst bit test ori logical inclusive or immediate chk check register against bounds pea push effective address chk2 check register against upper and reset reset external devices lower bounds rol, ror rotate left and right clr clear operand roxl, roxr rotate with extend left and right cmp compare rtd return and deallocate cmpa compare address rte return from exception cmpi compare immediate rtr return and restore cmpm compare memory rts return from subroutine cmp2 compare register against upper sbcd subtract decimal with extend and lower bounds scc set conditionally dbcc test condition, decrement and stop stop branch (16 tests) sub subtract divs, divsl signed divide suba subtract address divu, divul unsigned divide subi subtract immediate eor logical exclusive or subq subtract quick eori logical exclusive or immediate subx subtract with extend exg exchange registers swap swap data register halves ext, extb sign extend tas test and set operand illegal take illegal instruction trap tbls, tblsn table lookup and interpolate, jmp jump signed jsr jump to subroutine tblu, tblun table lookup and interpolate, lea load effective address unsigned link link and allocate trapcc trap conditionally (16 tests) lpstop low-power stop trapv trap on overflow lsl, lsr logical shift left and right tst test move move unlk unlink
cpu32+ 5-10 mc68360 user? manual motorola 5.3.1 m68000 family compatibility it is the philosophy of the m68000 family that all user-mode programs should execute unchanged on a more advanced processor and that supervisor-mode programs and excep- tion handlers should require only minimal alteration. the cpu32+ can be thought of as an intermediate member of the m68000 family. object code from an mc68000 or mc68010 may be executed on the cpu32+, and many of the instruction and addressing mode extensions of the mc68020 are also supported. 5.3.1.1 new instructions. two instructions have been added to the m68000 instruc- tion set: lpstop and tbl. 5.3.1.2 low-power stop (lpstop). in applications where power consumption is a consideration, the cpu32+ can force the device into a low-power standby mode when immediate processing is not required. the low-power mode is entered by executing the lpstop instruction. the processor remains in this mode until a user-specified or higher level interrupt or a reset occurs. 5.3.1.3 table lookup and interpolate (tbl). to maximize throughput for real- time applications, reference data is often precalculated and stored in memory for quick access. the storage of sufficient data points can require an inordinate amount of memory. the tbl instruction uses linear interpolation to recover intermediate values from a sample of data points, thus conserving memory. when the tbl instruction is executed, the cpu32+ looks up two table entries bounding the desired result and performs a linear interpolation between them. byte, word, and long-word operand sizes are supported. the result can be rounded according to a round-to-nearest algorithm or returned unrounded along with the fractional portion of the calculated result (byte and word results only). this extra precision can be used to reduce cumulative error in complex calculations. see 5.3.4 using the tbl instructions for examples. 5.3.1.4 unimplemented instructions. the ability to trap on unimplemented instruc- tions allows user-supplied code to emulate unimplemented capabilities or to define special- purpose functions. however, motorola reserves the right to use all currently unimplemented instruction operation codes for future m68000 enhancements. see 5.5.2.8 illegal or unim- plemented instructions for more details. 5.3.2 instruction format and notation all instructions consist of at least one word. some instructions can have as many as seven words, as shown in figure 5-6. the first word of the instruction, called the operation word, specifies instruction length and the operation to be performed. the remaining words, called extension words, further specify the instruction and operands. these words may be imme- diate operands, extensions to the effective address mode specified in the operation word, branch displacements, bit number, special register specifications, trap operands, or argu- ment counts.
cpu32+ motorola mc68360 user? manual 5-11 besides the operation code, which specifies the function to be performed, an instruction de- fines the location of every operand for the function. instructions specify an operand location in one of three ways: register specification a register field of the instruction contains the num- ber of the register. effective address an effective address field of the instruction con- tains address mode information. implicit reference the definition of an instruction implies the use of specific registers. the register field within an instruction specifies the register to be used. other fields within the instruction specify whether the register is an address or data register and how it is to be used. the m68000pm/ad, m68000 family programmer? reference manual , contains detailed register information. except where noted, the following notation is used in this section: data immediate data from an instruction destination destination contents source source contents vector location of exception vector an any address register (a7?0) ax, ay address registers used in computation dn any data register (d7?0) rc control register (vbr, sfc, dfc) rn any address or data register dh, dl data registers, high- and low-order 32 bits of product dr, dq data registers, division remainder, division quotient dx, dy data registers, used in computation dym, dyn data registers, table interpolation values 15 0 operation word (one word, specifies operation and modes) special operand specifiers (if any, one or two words) immediate operand or source address extension (if any, one to three words) destination effective address extension (if any, one to three words) figure 5-6. instruction word general format
cpu32+ 5-12 mc68360 user? manual motorola xn index register [an] address extension cc condition code d # displacement example: d 16 is a 16-bit displacement ea effective address # data immediate data; a literal integer label assembly program label list list of registers example: d3?0 [...] bits of an operand examples: [7] is bit 7; [31:24] are bits 31?4 (...) contents of a referenced location example: (rn) refers to the contents of rn ccr condition code register (lower byte of sr) x?xtend bit n?egative bit z?ero bit v?verflow bit c?arry bit pc program counter sp active stack pointer sr status register ssp supervisor stack pointer usp user stack pointer fc function code dfc destination function code register sfc source function code register + arithmetic addition or postincrement arithmetic subtraction or predecrement / arithmetic division or conjunction symbol arithmetic multiplication = equal to
cpu32+ motorola mc68360 user? manual 5-13 not equal to > greater than greater than or equal to < less than less than or equal to l logical and v logical or logical exclusive or ~ invert; operand is logically complemented bcd binary-coded decimal, indicated by subscript example: source 10 is a bcd source operand. lsw least significant word msw most significant word {r/w} read/write indicator in a description of an operation, a destination operand is placed to the right of source oper- ands and is indicated by an arrow ( ?. 5.3.3 instruction summary the instructions form a set of tools to perform the following operations: data movement bit manipulation integer arithmetic binary-coded decimal arithmetic logic program control shift and rotate system control the complete range of instruction capabilities combined with the addressing modes de- scribed previously provide flexibility for program development. all cpu32+ instructions are summarized in table 5-2.
cpu32+ 5-14 mc68360 user? manual motorola table 5-2. instruction set summary opcode operation syntax abcd source 10 + destination 10 + x ? destination abcd dy,dx abcd ?ay),?ax) add source + destination ? destination add ea ,dn add dn, ea adda source + destination ? destination adda ea ,an addi immediate data + destination ? destination addi # data ? ea addq immediate data + destination ? destination addq # data ? ea addx source + destination + x ? destination addx dy,dx addx ?ay),?ax) and source l destination ? destination and ea ? dn and dn, ea andi immediate data l destination ? destination andi # data ? ea andi to ccr source l ccr ? ccr andi # data ,ccr andi to sr if supervisor state the source l sr ? sr else trap andi # data ,sr asl,asr destination shifted by count ? destination asd dx,dy asd # data ,dy asd ea bcc if (condition true) then pc + d ? pc bcc label bchg ~( number of destination) ? z; ~( number of destination) ? bit number of destination bchg dn, ea bchg #data ? ea bclr ~( number of destination) ? z; 0 ? bit number of destination bclr dn, ea bclr # data ? ea bgnd if (background mode enabled) then enter background mode else format/vector offset ?ssp) pc ?ssp) sr ?ssp) (vector) pc bgnd bkpt run breakpoint acknowledge cycle; trap as illegal instruction bkpt # data bra pc + d ? pc bra label bset ~( number of destination) ? z; 1 ? bit number of destination bset dn, ea bset # data ? ea bsr sp ?4 ? sp; pc ? (sp); pc + d ? pc bsr label btst ?( number of destination) ? z; btst dn, ea btst # data ? ea chk if dn < 0 or dn > source then trap chk ea ,dn chk2 if rn < lower bound or if rn > upper bound then trap chk2 ea ,rn clr 0 ? destination clr ea cmp destination source cc cmp ea ,dn cmpa destination ?source cmpa ea ,an cmpi destination ?immediate data cmpi # data ? ea cmpm destination ?source ? cc cmpm (ay)+,(ax)+
cpu32+ motorola mc68360 user? manual 5-15 table 5-2. instruction set summary (continued) opcode operation syntax cmp2 compare rn < lower-bound or rn > upper-bound and set condition codes cmp2 ea ,rn dbcc if condition false then (dn ?1 ? dn; if dn ? then pc + d pc) dbcc dn, label divs divsl destination/source destination divs.w ea ,dn 32/16 ? 16r:16q divs.l ea ,dq 32/32 32q divs.l ea ,dr:dq 64/32 ? 32r:32q divsl.l ea ,dr:dq 32/32 32r:32q divu divul destination/source destination divu.w ea ,dn 32/16 ? 16r:16q divu.l ea ,dq 32/32 32q divu.l ea ,dr:dq 64/32 ? 32r:32q divul.l ea ,dr:dq 32/32 32r:32q eor source ? destination ? destination eor dn, ea eori immediate data destination ? destination eori # data ? ea eori to ccr source ccr ? ccr eori # data ,ccr eori to sr if supervisor state the source sr ? sr else trap eori # data ,sr exg rx ry exg dx,dy exg ax,ay exg dx,ay exg ay,dx ext extb destination sign-extended destination ext.w dn extend byte to word ext.l dn extend word to long word extb.l dn extend byte to long word llegal ssp ?2 ssp; vector offset (ssp); ssp ?4 ssp; pc (ssp); ssp ?2 ssp; sr ? (ssp); illegal instruction vector address pc illegal jmp destination address pc jmp ea jsr sp ?4 sp; pc (sp) destination address pc jsr ea lea ea an lea ea ,an link sp ?4 sp; an (sp) sp ? an, sp + d sp link an,# displacement lpstop if supervisor state immediate data ? sr interrupt mask external bus interface (ebi) stop else trap lpstop # data lsl,lsr destination shifted by count ? destination lsd 1 dx,dy lsd 1 # data ,dy lsd 1 ea move source destination move ea ? ea movea source destination movea ea ,an move from ccr ccr ? destination move ccr, ea move to ccr source ? ccr move ea ,ccr move from sr if supervisor state then sr ? destination else trap move sr, ea move to sr if supervisor state then source ? sr else trap move ea ,sr
cpu32+ 5-16 mc68360 user? manual motorola table 5-2. instruction set summary (continued) opcode operation syntax move usp if supervisor state then usp an or an usp else trap move usp,an move an,usp movec if supervisor state then rc ? rn or rn ? rc else trap movec rc,rn movec rn,rc movem registers ? destination source ? registers movem register list, ea movem ea ,register list movep source ? destination movep dx,(d,ay) movep (d,ay),dx moveq immediate data ? destination moveq # data ,dn moves if supervisor state then rn ? destination [dfc] or source [sfc] ? rn else trap moves rn, ea moves ea ,rn muls source ? destination ? destination muls.w ea ,dn 16 ? 16 32 muls.l ea ,dl 32 ? 32 32 muls.l ea ,dh:dl 32 ? 32 64 mulu source ? destination ? destination mulu.w ea ,dn 16 ? 16 32 mulu.l ea ,dl 32 ? 32 32 mulu.l ea ,dh:dl 32 ? 32 64 nbcd 0 ?(destination 10 ) ?x destination nbcd ea neg 0 ?(destination) ? destination neg ea negx 0 ?(destination) ?x ? destination negx ea nop none nop not ~destination ? destination not ea or source v destination destination or ea ,dn or dn, ea ori immediate data v destination ? destination ori # data , ea ori to ccr source v ccr ccr ori # data ,ccr ori to sr if supervisor state then source v sr sr else trap ori # data ,sr pea sp ?4 sp; ea (sp) pea ea reset if supervisor state then assert reset else trap reset rol,ror destination rotated by count destination rod 1 rx,dy rod 1 # data ,dy rod 1 ea roxl,roxr destination rotated with x by count destination roxd 1 rx,dy roxd 1 # data ,dy roxd 1 ea rtd (sp) pc; sp + 4 + d sp rtd # displacement rte if supervisor state the (sp) sr; sp + 2 sp; (sp) pc; sp + 4 sp; restore state and deallocate stack according to (sp) else trap rte rtr (sp) ccr; sp + 2 sp; (sp) pc; sp + 4 ? sp rtr
cpu32+ motorola mc68360 user? manual 5-17 5.3.3.1 condition code register. the ccr portion of the sr contains five bits that indicate the result of a processor operation. table 5-2 lists the effect of each instruction on these bits. the carry bit and the multiprecision extend bit are separate in the m68000 family to simplify programming techniques that use them. refer to table 5-3 as an example. table 5-2. instruction set summary (concluded) opcode operation syntax rts (sp) pc; sp + 4 ? sp rts sbcd destination 10 ?source 10 ?x destination sbcd dx,dy sbcd ?ax),?ay) scc if condition true then 1s ? destination else 0s ? destination scc ea stop if supervisor state then immediate data sr; stop else trap stop # data sub destination ?source ? destination sub ea ,dn sub dn, ea suba destination ?source ? destination suba ea ,an subi destination ?immediate data ? destination subi # data , ea subq destination ?immediate data ? destination subq # data , ea subx destination ?source ?x ? destination subx dx,dy subx ?ax),?ay) swap register [31:16] register [15:0] swap dn tas destination tested ? condition codes; 1 ? bit 7 of destination tas ea tbls entry(n) + {(entry(n + 1) ?entry(n)) d x[7:0]} / 256 ? dx tbls. size ea , dx tbls. size dym:dyn, dx tblsn entry(n) 256 + {(entry(n + 1) ?entry(n)) ? dx [7:0]} ? dx tblsn. size ea ,dx tblsn. size dym:dyn, dx tblu entry(n) + {(entry(n + 1) ?entry(n)) dx[7:0]} / 256 dx tblu. size ea ,dx tblu. size dym:dyn, dx tblun entry(n) 256 + {(entry(n + 1) ?entry(n)) ? dx[7:0]} ? dx tblun. size ea ,dx tblun. size dym:dyn,dx trap ssp ?2 ssp; format/offset (ssp); ssp ?4 ssp; pc (ssp); ssp ?2 ssp; sr (ssp); vector address pc trap # vector trapcc if cc then trap trapcc trapcc.w # data trapcc.l # data trapv if v then trap trapv tst destination tested ? condition codes tst ea unlk an sp; (sp) ? an; sp + 4 ? sp unlk an note 1: d is direction, l or r.
cpu32+ 5-18 mc68360 user? manual motorola ) table 5-3. condition code computations operations x n z v c special definition abcd * u?u? c = decimal carry z = z l rm l ... l r0 add, addi, addq * * * ? ? v = sm l dm l rm v sm l dm l rm c = sm l dm v rm l dm v sm l rm addx * * ? ? ? v = sm l dm l rm v sm l dm l rm c = sm l dm v rm l dm v sm l rm z = z l rm l ... l r0 and, andi, eor, eori, moveq, move, or, ori, clr, ext, not, tas, tst ? * 0 0 chk * u u u chk2, cmp2 u?u? z = (r = lb) v ( r = ub ) c = (lb < ub) l (ir < lb) v ( r > ub) v ( ub < lb) l (r > ub) l (r < lb) sub, subi, subq * * * ? ? v = sm l dm l rm v sm l dm l rm c = sm l dm v rm l dm v sm l rm subx * * ? ? ? v = sm l dm l rm v sm l dm l rm c = sm l dm v rm l dm v sm l rm z = z l rm l ... l r0 cmp, cmpi, cmpm * * ? ? v = sm l dm l rm v sm l dm l rm c = sm l dm v rm l dm v sm l rm divs, divu * * ? 0 v = division overflow muls, mulu * * ? 0 v = multiplication overflow sbcd, nbcd * u?u? c = decimal borrow z = z l rm l ... l r0 neg * * * ? ? v = dm l rm c = dm v rm negx * * ? ? ? v = dm l rm c = dm v rm z = z l rm l ... l r0 asl * * * ? ? v = dm l (dm ?1 v ... v dm ?r ) v dm l (dm ?1 v ... + dm ?r) c = dm ?r + 1 asl (r = 0) * * 0 0 lsl, roxl * * * 0 ? c = dm ?r + 1 lsr (r = 0) * * 0 0 roxl (r = 0) * * 0 ? c = x rol * * 0 ? c = dm ?r + 1 rol (r = 0) * * 0 0 asr, lsr, roxr * * * 0 ? c = dr ?1 asr, lsr (r = 0) * * 0 0 roxr (r = 0) * * 0 ? c = x ror * * 0 ? ror (r = 0) * * 0 0
cpu32+ motorola mc68360 user? manual 5-19 5.3.3.2 data movement instructions. the move instruction is the basic means of transferring and storing address and data. move instructions transfer byte, word, and long- word operands from memory to memory, memory to register, register to memory, and reg- ister to register. address movement instructions (move or movea) transfer word and long- word operands and ensure that only valid address manipulations are executed. in addition to the general move instructions, there are several special data movement instructions?ove multiple registers (movem), move peripheral data (movep), move quick (moveq), exchange registers (exg), load effective address (lea), push effective address (pea), link stack (link), and unlink stack (unlk). table 5-4 is a summary of the data movement operations. 5.3.3.3 integer arithmetic operations. the arithmetic operations include the four basic operations of add (add), subtract (sub), multiply (mul), and divide (div) as well as arithmetic compare (cmp, cmpm, cmp2), clear (clr), and negate (neg). the instruction set includes add, cmp, and sub instructions for both address and data operations with all table 5-3. condition code computations (continued) note: the following notations apply to this table only. = not affected sm = source operand msb u = undefined dm = destination operand msb ? = see special definition rm = result operand msb * = general case r = register tested x = c n = bit number n = rm r = shift count z=rm l ... l r0 lb = lower bound l= boolean and ub = upper bound v = boolean or rm = not rm table 5-4. data movement operations instruction operand syntax operand size operation exg rn, rn 32 rn ? rn lea ea , an 32 ea ? an link an, # d 16, 32 sp ?4 ? sp, an ? (sp); sp ? an, sp + d ? sp move ea , ea 8, 16, 32 source ? destination movea ea , an 16, 32 ? 32 source ? destination movem list, ea ea , list 16, 32 16, 32 ? 32 listed registers ? destination source ? listed registers movep dn, (d 16 , an) (d 16 , an), dn 16, 32 dn [31:24] ? (an + d); dn [23:16] ? (an + d + 2); dn [15:8] ? (an + d + 4); dn [7:0] ? (an + d + 6) (an + d) ? dn [31:24]; (an + d + 2) ? dn [23:16]; (an + d + 4) ? dn [15:8]; (an + d + 6) ? dn [7:0] moveq # data ? dn 8 ? 32 immediate data ? destination pea ea 32 sp ?4 ? sp; ea ? sp unlk an 32 an ? sp; (sp) ? an, sp + 4 ? sp
cpu32+ 5-20 mc68360 user? manual motorola operand sizes valid for data operations. address operands consist of 16 or 32 bits. the clear and negate instructions apply to all sizes of data operands. signed and unsigned mul and div instructions include: word multiply to produce a long-word product long-word multiply to produce a long-word or quad-word product division of a long-word dividend by a word divisor (word quotient and word remainder) division of a long-word or quad-word dividend by a long-word divisor (long-word quo- tient and long-word remainder) a set of extended instructions provides multiprecision and mixed-size arithmetic. these instructions are add extended (addx), subtract extended (subx), sign extend (ext), and negate binary with extend (negx). refer to table 5-5 for a summary of the integer arith- metic operations.
cpu32+ motorola mc68360 user? manual 5-21 5.3.3.4 logic instructions. the logical operation instructions (and, or, eor, and not) perform logical operations with all sizes of integer data operands. a similar set of immediate instructions (andi, ori, and eori) provide these logical operations with all sizes of immediate data. the test (tst) instruction arithmetically compares the operand with zero, placing the result in the ccr. table 5-6 summarizes the logical operations. table 5-5. integer arithmetic operations instruction operand syntax operand size operation add dn, ea ea , dn 8, 16, 32 8, 16, 32 source + destination ? destination adda ea , an 16, 32 source + destination ? destination addi # data ? ea 8, 16, 32 immediate data + destination ? destination addq # data ? ea 8, 16, 32 immediate data + destination ? destination addx dn, dn ?(an), ?(an) 8, 16, 32 8, 16, 32 source + destination + x ? destination clr ea 8, 16, 32 0 ? destination cmp ea , dn 8, 16, 32 (destination ?source), ccr shows results cmpa ea , an 16, 32 (destination ?source), ccr shows results cmpi # data ? ea 8, 16, 32 (destination ?immediate data), ccr shows results cmpm (an) +, (an) + 8, 16, 32 (destination ?source), ccr shows results cmp2 ea , rn 8, 16, 32 lower bound ? rn upper bound, ccr shows results divs/divu divsl/divul ea , dn ea , dr:dq ea , dq ea , dr:dq 32/16 16:16 64/32 32:32 32/32 32 32/32 32:32 destination/source ? destination (signed or un- signed) ext dn dn 8 16 16 32 sign extended destination ? destination extb dn 8 32 sign extended destination ? destination muls/mulu ea , dn ea , dl ea , dh:dl 16 16 32 32 32 32 32 32 64 source ? destination ? destination (signed or un- signed) neg ea 8, 16, 32 0 ?destination destination negx ea 8, 16, 32 0 ?destination ?x destination sub ea , dn dn, ea 8, 16, 32 destination ?source ? destination suba ea , an 16, 32 destination ?source ? destination subi # data ? ea 8, 16, 32 destination ?immediate data ? destination subq # data ? ea 8, 16, 32 destination ?immediate data ? destination subx dn, dn ?(an), ?(an) 8, 16, 32 8, 16, 32 destination ?source ?x ? destination tbls/tblu ea , dn dym:dyn, dn 8, 16, 32 dyn ?dym temp (temp dn [7:0]) ? temp (dym ? 256) + temp ? dn tblsn/tblun ea , dn dym:dyn, dn 8, 16, 32 dyn ?dym temp (temp dn [7:0]) / 256 temp dym + temp dn
cpu32+ 5-22 mc68360 user? manual motorola 5.3.3.5 shift and rotate instructions. the arithmetic shift instructions, asr and asl, and logical shift instructions, lsr and lsl, provide shift operations in both directions. the ror, rol, roxr, and roxl instructions perform rotate (circular shift) operations, with and without the extend bit. all shift and rotate operations can be performed on either registers or memory. register shift and rotate operations shift all operand sizes. the shift count may be specified in the instruction operation word (to shift from 1 to 8 places) or in a register (modulo 64 shift count). memory shift and rotate operations shift word-length operands one bit position only. the swap instruction exchanges the 16-bit halves of a register. performance of shift/rotate instructions is enhanced so that use of the ror and rol instructions with a shift count of eight allows fast byte swapping. table 5-7 is a summary of the shift and rotate operations. table 5-6. logic operations instruction operand syntax operand size operation and ea , dn dn, ea 8, 16, 32 8, 16, 32 source l destination ? destination andi # data ? ea 8, 16, 32 immediate data l destination ? destination eor dn, ea 8, 16, 32 source ? destination ? destination eori # data ? ea 8, 16, 32 immediate data ? destination ? destination not ea 8, 16, 32 destination ? destination or ea , dn dn, ea 8, 16, 32 8, 16, 32 source v destination ? destination ori # data ? ea 8, 16, 32 immediate data v destination ? destination tst ea 8, 16, 32 source ?0, to set condition codes
cpu32+ motorola mc68360 user? manual 5-23 5.3.3.6 bit manipulation instructions. bit manipulation operations are accom- plished using the following instructions: bit test (btst), bit test and set (bset), bit test and clear (bclr), and bit test and change (bchg). all bit manipulation operations can be per- formed on either registers or memory. the bit number is specified as immediate data or in a data register. register operands are 32 bits, and memory operands are 8 bits. table 5-8 is a summary of bit manipulation instructions. table 5-7. shift and rotate operations instruction operand syntax operand size operation asl dn, dn # data ? dn ea 8, 16, 32 8, 16, 32 16 asr dn, dn # data ? dn ea 8, 16, 32 8, 16, 32 16 lsl dn, dn # data ? dn ea 8, 16, 32 8, 16, 32 16 lsr dn, dn # data ? dn ea 8, 16, 32 8, 16, 32 16 rol dn, dn # data ? dn ea 8, 16, 32 8, 16, 32 16 ror dn, dn # data ? dn ea 8, 16, 32 8, 16, 32 16 roxl dn, dn # data ? dn ea 8, 16, 32 8, 16, 32 16 roxr dn, dn # data ? dn ea 8, 16, 32 8, 16, 32 16 swap dn 16 x/c 0 x/c x/c 0 x/c 0 c c x c x c msw lsw
cpu32+ 5-24 mc68360 user? manual motorola 5.3.3.7 binary-coded decimal (bcd) instructions. five instructions support operations on bcd numbers. the arithmetic operations on packed bcd numbers are add decimal with extend (abcd), subtract decimal with extend (sbcd), and negate decimal with extend (nbcd). table 5-9 is a summary of the bcd operations. 5.3.3.8 program control instructions. a set of subroutine call and return instructions and conditional and unconditional branch instructions perform program control operations. table 5-10 summarizes these instructions. table 5-8. bit manipulation operations instruction operand syntax operand size operation bchg dn, ea # data ? ea 8, 32 8, 32 ~( bit number of destination) ? z ? bit of destination bclr dn, ea # data ? ea 8, 32 8, 32 ~( bit number of destination) ? z; 0 ? bit of destination bset dn, ea # data ? ea 8, 32 8, 32 ~( bit number of destination) ? z; 1 ? bit of destination btst dn, ea # data ? ea 8, 32 8, 32 ~ ( bit number of destination) ? z table 5-9. binary-coded decimal operations instruction operand syntax operand size operation abcd dn, dn ?(an), ?(an) 8 8 source 10 + destination 10 + x ? destination nbcd ea 8 8 0 ?destination 10 ?x ? destination sbcd dn, dn ?(an), ?(an) 8 8 destination 10 ?source 10 ?x ? destination
cpu32+ motorola mc68360 user? manual 5-25 to specify conditions for change in program control, condition codes must be substituted for the letters "cc" in conditional program control opcodes. condition test mnemonics are given below. refer to 5.3.3.10 condition tests for detailed information on condition codes. ?c carry clear ls low or same ?s carry set lt less than ?q equal mi minus ? false * ne not equal ?e greater or equal pl plus ?t greater than t true ?i high vc overflow clear ?e less or equal vs overflow set * not applicable to the bcc instruction 5.3.3.9 system control instructions. privileged instructions, trapping instruc- tions, and instructions that use or modify the ccr provide system control operations. all of these instructions cause the processor to flush the instruction pipeline. table 5-11 summa- rizes the instructions. the preceding list of condition tests also applies to the trapcc instruction. refer to 5.3.3.10 condition tests for detailed information on condition codes. table 5-10. program control operations instruction operand syntax operand size operation conditional bcc label 8, 16, 32 if condition true, then pc + d ? pc dbcc dn , label 16 if condition false, then dn ?1 ? pc; if dn ?( ?1), then pc + d ? pc scc ea 8 if condition true, then destination bits are set to 1; else destination bits are cleared to 0 unconditional bra label 8, 16, 32 pc + d ? pc bsr label 8, 16, 32 sp ?4 ? sp; pc ? (sp); pc + d ? pc jmp ea none destination ? pc jsr ea none sp ?4 ? sp; pc ? (sp); destination ? pc nop none none pc + 2 ? pc returns rtd # d 16 (sp) ? pc; sp + 4 + d ? sp rtr none none (sp) ? ccr; sp + 2 sp; (sp) ? pc; sp + 4 ? sp rts none none (sp) ? pc; sp + 4 ? sp
cpu32+ 5-26 mc68360 user? manual motorola 5.3.3.10 condition tests. conditional program control instructions and the trapcc instruction execute on the basis of condition tests. a condition test is the evaluation of a log- ical expression related to the state of the ccr bits. if the result is 1, the condition is true. if table 5-11. system control operations instruction operand syntax operand size operation privileged andi # data , sr 16 immediate data l sr ? sr eori # data , sr 16 immediate data ? sr ? sr move ea , sr sr, ea 16 16 source ? sr sr ? destination movea usp, an an, usp 32 32 usp ? an an usp movec rc, rn rn, rc 32 32 rc ? rn rn ? rc moves rn, ea ea , rn 8, 16, 32 rn ? destination using dfc source using sfc ? rn ori # data , sr 16 immediate data v sr ? sr reset none none assert reset line rte none none (sp) ? sr; sp + 2 ? sp; (sp) ? pc; sp + 4 ? sp; restore stack according to format stop # data 16 immediate data ? sr; stop lpstop # data none immediate data ? sr; interrupt mask ? ebi; stop trap generating bkpt # data none if breakpoint cycle acknowledged, then execute re- turned operation word, else trap as illegal instruction. bgnd none none if background mode enabled, then enter background mode, else format/vector offset ? ?(ssp); pc ? ?(ssp); sr ? ?(ssp); (vector) ? pc chk ea , dn 16, 32 if dn < 0 or dn < (ea), then chk exception chk2 ea , rn 8, 16, 32 if rn < lower bound or rn > upper bound, then chk exception illegal none none ssp ?2 ? ssp; vector offset ? (ssp); ssp ?4 ? ssp; pc ? (ssp); ssp ?2 ? ssp; sr ? (ssp); llegal instruction vector address ? pc trap # data none ssp ?2 ? ssp; format/vector offset ? (ssp); ssp ?4 ? ssp; pc ? (ssp); sr ? (ssp); vector address ? pc trapcc none # data none 16, 32 if cc true, then trap exception trapv none none if v set, then overflow trap exception condition code register andi # data ? ccr 8 immediate data l ccr ? ccr eori # data ? ccr 8 immediate data ? ccr ? ccr move ea , ccr ccr, ea 16 16 source ? ccr ccr ? destination ori # data ? ccr 8 immediate data v ccr ? ccr
cpu32+ motorola mc68360 user? manual 5-27 the result is 0, the condition is false. for example, the t condition is always true, and the eq condition is true only if the z-bit condition code is true. table 5-12 lists each condition test. 5.3.4 using the tbl instructions there are four tbl instructions. tbls returns a signed, rounded byte, word, or long-word result. tblsn returns a signed, unrounded byte, word, or long-word result. tblu returns an unsigned, rounded byte, word, or long-word result. tblun returns an unsigned, unrounded byte, word, or long-word result. all four instructions support two types of interpolation data: an n-element table stored in memory and a two-element range stored in a pair of data reg- isters. the latter form provides a means of performing surface (3d) interpolation between two previously calculated linear interpolations. the following examples show how to compress tables and use fewer interpolation levels between table entries. example 1 (see figure 5-7) demonstrates tbl for a 257-entry table, allowing up to 256 interpolation levels between entries. example 2 (see figure 5-8) reduces table length for the same data to four entries. example 3 (see figure 5-9) demonstrates use of an 8-bit independent variable with an instruction. two additional examples show how tblsn can reduce cumulative error when multiple table lookup and interpolation operations are used in a calculation. example 4 demonstrates addi- tion of the results of three table interpolations. example 5 illustrates use of tblsn in surface interpolation. table 5-12. condition tests mnemonic condition encoding test t true 0000 1 f* false 0001 0 hi high 0010 c z ls low or same 0011 c + z cc carry clear 0100 c cs carry set 0101 c ne not equal 0110 z eq equal 0111 z vc overflow clear 1000 v vs overflow set 1001 v pl plus 1010 n mi minus 1011 n ge greater or equal 1100 n v + n v lt less than 1101 n v + n v gt greater than 1110 n v z + n v z le less or equal 1111 z + n v + n v * not available for the bcc instruction. =boolean and +=boolean or n=boolean not
cpu32+ 5-28 mc68360 user? manual motorola 5.3.4.1 table example 1: standard usage. the table consists of 257 word entries. as shown in figure 5-7, the function is linear within the range 32768 x 49152. table entries within this range are as given in table 5-13 . *these values are the end points of the range. all entries between these points fall on the line. figure 5-7. table example 1 the table instruction is executed with the following bit pattern in dx: table entry offset dx [8:15] = $a3 = 163 interpolation fraction dx [0:7] = $80 = 128 using this information, the table instruction calculates dependent variable y: y = 1669 + (128 (1679 ?1669)) / 256 = 1674 table 5-13. standard usage entries entry number x-value y-value 128* 32768 1311 162 41472 1659 163 41728 1669 164 41984 1679 165 42240 1690 192* 49152 1966 31 16 15 0 not used 1 0 10001110000000 x 16384 32768 49152 65536 independent variable dependent variable y
cpu32+ motorola mc68360 user? manual 5-29 5.3.4.2 table example 2: compressed table. in example 2 (see figure 5-8), the data from example 1 has been compressed by limiting the maximum value of the indepen- dent variable. instead of the range 0 x = 65535, x is limited to 0 x 1023. the table has been compressed to only five entries, but up to 256 levels of interpolation are allowed between entries. figure 5-8. table example 2 note extreme table compression with many levels of interpolation is possible only with highly linear functions. the table entries within the range of interest are listed in table 5-14. since the table is reduced from 257 to 5 entries, independent variable x must be scaled appropriately. in this case the scaling factor is 64, and the scaling is done by a single instruc- tion: lsr.w #6,dx table 5-14. compressed table entries entry number x-value y-value 2 512 1311 3 786 1966 x 256 512 786 1024 independent variable dependent variable y
cpu32+ 5-30 mc68360 user? manual motorola thus, dx now contains the following bit pattern: table entry offset dx [8:15] = $02 = 2 interpolation fraction dx [0:7] = $8e = 142 using this information, the table instruction calculates dependent variable y: y = 1331 + (142 (1966 ?1311)) / 256 = 1674 the function chosen for examples 1 and 2 is linear between data points. if another function had been used, interpolated values might not have been identical. 5.3.4.3 table example 3: 8-bit independent variable. this example shows how to use a table instruction within an interpolation subroutine. independent variable x is calculated as an 8-bit value, allowing 16 levels of interpolation on a 17-entry table. x is passed to the subroutine, which returns an 8-bit result. the subroutine uses the data listed in table 5-15, based on the function shown in figure 5-9. figure 5-9. table example 3 31 16 15 0 not used 0 0 00001010001110 y x 1024 2048 3072 4096 independent variable independent variable
cpu32+ motorola mc68360 user? manual 5-31 the first column is the value passed to the subroutine, the second column is the value expected by the table instruction, and the third column is the result returned by the subrou- tine. the following value has been calculated for independent variable x: since x is an 8-bit value, the upper four bits are used as a table offset, and the lower four bits are used as an interpolation fraction. the following results are obtained from the sub- routine: table entry offset dx [4:7] = $b = 11 interpolation fraction dx [0:3] = $d = 13 thus, y is calculated as follows: y = 80 + (13 (64 ?80)) / 16 = 67 if the 8-bit value for x were used directly by the table instruction, interpolation would be in- correctly performed between entries 0 and 1. data must be shifted to the left four places be- fore use: lsl.w #4, dx table 5-15. t8-bit independent variable entries x (subroutine) x (instruction) y 000 1 256 16 2 512 32 3 768 48 4 1024 64 5 1280 80 6 1536 96 7 1792 112 8 2048 128 9 2304 112 10 2560 96 11 2816 80 12 3072 64 13 3328 48 14 3584 32 15 3840 16 16 4096 0 31 16 15 0 not used 0 0 00000010111101
cpu32+ 5-32 mc68360 user? manual motorola the new range for x is 0 x 4096; however, since a left shift fills the least significant digits of the word with zeros, the interpolation fraction can only have one of 16 values. after the shift operation, dx contains the following value: execution of the table instruction using the new value in dx yields: table entry offset dx [8:15] = $0b = 11 interpolation fraction dx [0:7] = $d0 = 208 thus, y is calculated as follows: y = 80 + (208 (64 ?80)) / 256 = 67 5.3.4.4 table example 4: maintaining precision. in this example, three tbl operations are performed and the results are summed. the calculation is done once with the result of each tbl rounded before addition and once with only the final result rounded. assume that the result of the three interpolations are as follows (a ".'' indicates the binary radix point). first, the results of each tbl are rounded with the tbls round-to-nearest-even algorithm. the following values would be returned by tbls: summing, the following result is obtained: now, using the same tbl results, the sum is first calculated and then rounded according to the same algorithm: 31 16 15 0 not used 000010111 1 010000 tbl # 1 0010 0000 . 0111 0000 tbl# 2 0011 1111 . 0111 0000 tbl # 3 0000 0001 . 0111 0000 tbl # 1 0010 0000 . tbl # 2 0011 1111 . tbl # 3 0000 0001 . 0010 0000 . 0011 1111 . 0000 0001 . 0110 0000 .
cpu32+ motorola mc68360 user? manual 5-33 rounding yields: the second result is preferred. the following code sequence illustrates how addition of a series of table interpolations can be performed without loss of precision in the intermediate results: l0: tblsn.b ea ? dx tblsn.b ea ? dx tblsn.b ea ? dl add.l dx, dm long addition avoids problems with carry add.l dm, dl asr.l #8, dl move radix point bcc.b l1 fraction msb in carry addq.b #1, dl l1: . . . 5.3.4.5 table example 5: surface interpolations. the various forms of table can be used to perform surface (3d) tbls. however, since the calculation must be split into a series of 2d tbls, it is possible to lose precision in the intermediate results. the following code sequence, incorporating both tbls and tblsn, eliminates this possibility. l0: move.w dx, dl copy entry number and fraction number tblsn.b ea , dx tblsn.b ea ? dl tbls.w dx:dl, dm surface interpolation, with round asr.l #8, dm read just the result bcc.b l1 no round necessary addq.b #1, dl half round up l1: . . . before execution of this code sequence, dx must contain fraction and entry numbers for the two tbl, and dm must contain the fraction for surface interpolation. the ea fields in the tblsn instructions point to consecutive columns in a 3d table. the tbls size parameter must be word if the tblsn size parameter is byte, and must be long word if tblsn is word. increased size is necessary because a larger number of significant digits is needed to accommodate the scaled fractional results of the 2d tbl. 5.3.5 nested subroutine calls the link instruction pushes an address onto the stack, saves the stack address at which the address is stored, and reserves an area of the stack for use. using this instruction in a series of subroutine calls will generate a linked list of stack frames. 0010 0000 . 0111 0000 0011 1111 . 0111 0000 0000 0001 . 0111 0000 0110 0001 . 0101 0000 0110 0001 .
cpu32+ 5-34 mc68360 user? manual motorola the unlk instruction removes a stack frame from the end of the list by loading an address into the sp and pulling the value at that address from the stack. when the instruction oper- and is the address of the link address at the bottom of a stack frame, the effect is to remove the stack frame from both the stack and the linked list. 5.3.6 pipeline synchronization with the nop instruction although the no operation (nop) instruction performs no visible operation, it does force syn- chronization of the instruction pipeline, since all previous instructions must complete execu- tion before the nop begins. 5.4 processing states this section describes the processing states of the cpu32+. it includes a functional descrip- tion of the bits in the supervisor portion of the sr and an overview of actions taken by the processor in response to exception conditions. 5.4.1 state transitions the processor is always in one of four processing states: normal, background, exception, or halted. when the processor fetches instructions and operands or executes instructions, it is in the normal processing state. the stopped condition, which the processor enters when a stop or lpstop instruction is executed, is a variation of the normal state in which no further bus cycles are generated. background state is an alternate operational mode used for system debugging. refer to 5.6 development support for more information. exception processing refers specifically to the transition from normal processing of a pro- gram to normal processing of system routines, interrupt routines, and other exception han- dlers. exception processing includes the stack operations, the exception vector fetch, and the filling of the instruction pipeline caused by an exception. exception processing ends when execution of an exception handler routine begins. refer to 5.5 exception processing for comprehensive information. a catastrophic system failure occurs if the processor detects a bus error or generates an address error while in the exception processing state. this type of failure halts the proces- sor. for example, if a bus error occurs during exception processing caused by another bus error, the cpu32+ assumes that the system is not operational and halts. the halted condition should not be confused with the stopped condition. after the processor executes a stop or lpstop instruction, execution of instructions can resume when a trace, interrupt, or reset exception occurs. 5.4.2 privilege levels to protect system resources, the processor can operate with either of two levels of access user or supervisor. supervisor level is more privileged than user level. all instructions are
cpu32+ motorola mc68360 user? manual 5-35 available at the supervisor level, but execution of some instructions is not permitted at the user level. there are separate sps for each level. the s-bit in the sr indicates privilege level and determines which sp is used for stack operations. the processor identifies each bus access (supervisor or user mode) via function codes to enforce supervisor and user access levels. in a typical system, most programs execute at the user level. user programs can access only their own code and data areas and are restricted from accessing other information. the operating system executes at the supervisor privilege level, has access to all resources, per- forms the overhead tasks for the user level programs, and coordinates their activities. 5.4.2.1 supervisor privilege level. if the s-bit in the sr is set, supervisor privilege level applies, and all instructions are executable. the bus cycles generated for instructions executed in supervisor level are normally classified as supervisor references, and the values of the function codes on fc2?c0 refer to supervisor address spaces. all exception processing is performed at the supervisor level. all bus cycles generated dur- ing exception processing are supervisor references, and all stack accesses use the ssp. instructions that have important system effects can only be executed at supervisor level. for instance, user programs are not permitted to execute stop, lpstop, or reset instruc- tions. to prevent a user program from gaining privileged access, except in a controlled man- ner, instructions that can alter the s-bit in the sr are privileged. the trap #n instruction provides controlled user access to operating system services. 5.4.2.2 user privilege level. if the s-bit in the sr is cleared, the processor executes instructions at the user privilege level. the bus cycles for an instruction executed at the user privilege level are classified as user references, and the values of the function codes on fc2?c0 specify user address spaces. while the processor is at the user level, implicit ref- erences to the system sp and explicit references to address register seven (a7) refer to the usp. 5.4.2.3 changing privilege level. to change from user privilege level to supervisor privilege level, a condition that causes exception processing must occur. when exception processing begins, the current values in the sr, including the s-bit, are saved on the super- visor stack, and then the s-bit is set to enable supervisor access. execution continues at supervisor privilege level until exception processing is complete. to return to user access level, a system routine must execute one of the following instruc- tions: move to sr, andi to sr, eori to sr, ori to sr, or rte. these instructions execute only at supervisor privilege level and can modify the s-bit of the sr. after these instructions execute, the instruction pipeline is flushed, then refilled from the appropriate address space. the rte instruction causes a return to a program that was executing when an exception occurred. when rte is executed, the exception stack frame saved on the supervisor stack can be restored in either of two ways.
cpu32+ 5-36 mc68360 user? manual motorola if the frame was generated by an interrupt, breakpoint, trap, or instruction exception, the sr and pc are restored to the values saved on the supervisor stack, and execution resumes at the restored pc address, with access level determined by the s-bit of the restored sr. if the frame was generated by a bus error or an address error exception, the entire processor state is restored from the stack. 5.5 exception processing an exception is a special condition that pre-empts normal processing. exception processing is the transition from normal mode program execution to execution of a routine that deals with an exception. the following paragraphs discuss system resources related to exception handling, exception processing sequence, and specific features of individual exception pro- cessing routines. 5.5.1 exception vectors an exception vector is the address of a routine that handles an exception. the vbr contains the base address of a 1024-byte exception vector table, which consists of 256 exception vectors. sixty-four vectors are defined by the processor, and 192 vectors are reserved for user definition as interrupt vectors. except for the reset vector, which is two long words, each vector in the table is one long word. refer to table 5-16 for information on vector assign- ment. all exception vectors, except the reset vector, are located in supervisor data space. the reset vector is located in supervisor program space. only the initial reset vector is fixed in the processor memory map. when initialization is complete, there are no fixed assignments. since the vbr stores the vector table base address, the table can be located anywhere in memory. it can also be dynamically relocated for each task executed by an operating sys- tem. each vector is assigned an 8-bit number. vector numbers for some exceptions are obtained from an external device; others are supplied by the processor. the processor multiplies the vector number by 4 to calculate vector offset, then adds the offset to the contents of the vbr. the sum is the memory address of the vector. 5.5.1.1 types of exceptions. an exception can be caused by internal or external events. an internal exception can be generated by an instruction or by an error. the trap, trapcc, trapv, bkpt, chk, chk2, rte, and div instructions can cause exceptions during normal execution. illegal instructions, instruction fetches from odd addresses, word or long-word operand accesses from odd addresses, and privilege violations also cause internal excep- tions. sources of external exception include interrupts, breakpoints, bus errors, and reset requests. interrupts are peripheral device requests for processor action. breakpoints are used to support development equipment. bus error and reset are used for access control and processor restart.
cpu32+ motorola mc68360 user? manual 5-37 caution because there is no protection on the 64 processor-defined vec- tors, external devices can access vectors reserved for internal purposes. this practice is strongly discouraged. table 5-16. exception vector assignments vector offset vector number dec hex space assignment 0 0 000 sp reset: initial stack pointer 1 4 004 sp reset: initial program counter 2 8 008 sd bus error 3 12 00c sd address error 4 16 010 sd illegal instruction 5 20 014 sd zero division 6 24 018 sd chk, chk2 instructions 7 28 01c sd trapcc, trapv instructions 8 32 020 sd privilege violation 9 36 024 sd trace 10 40 028 sd line 1010 emulator 11 44 02c sd line 1111 emulator 12 48 030 sd hardware breakpoint 13 52 034 sd (reserved for coprocessor protocol violation) 14 56 038 sd format error 15 60 03c sd uninitialized interrupt 16?3 64 92 040 05c sd (unassigned, reserved) 24 96 060 sd spurious interrupt 25 100 064 sd level 1 interrupt autovector 26 104 068 sd level 2 interrupt autovector 27 108 06c sd level 3 interrupt autovector 28 112 070 sd level 4 interrupt autovector 29 116 074 sd level 5 interrupt autovector 30 120 078 sd level 6 interrupt autovector 31 124 07c sd level 7 interrupt autovector 32?7 128 188 080 0bc sd trap instruction vectors (0?5) 48?8 192 232 0c0 0e8 sd (reserved for coprocessor) 59?3 236 252 0ec 0fc sd (unassigned, reserved) 64?55 256 1020 100 3fc sd user-defined vectors (192)
cpu32+ 5-38 mc68360 user? manual motorola 5.5.1.2 exception processing sequence. for all exceptions other than a reset exception, exception processing occurs in the following sequence. refer to 5.5.2.1 reset for details of reset processing. as exception processing begins, the processor makes an internal copy of the sr. after the copy is made, the processor state bits in the sr are changed?he s-bit is set, establishing supervisor access level, and bits t1 and t0 are cleared, disabling tracing. for reset and interrupt exceptions, the interrupt priority mask is also updated. next, the exception number is obtained. for interrupts, the number is fetched from cpu space $f (the bus cycle is an interrupt acknowledge). for all other exceptions, internal logic provides a vector number. next, current processor status is saved. an exception stack frame is created and placed on the supervisor stack. all stack frames contain copies of the sr and the pc for use by rte. the type of exception and the context in which the exception occurs determine what other information is stored in the stack frame. finally, the processor prepares to resume normal execution of instructions. the exception vector offset is determined by multiplying the vector number by 4, and the offset is added to the contents of the vbr to determine displacement into the exception vector table. the exception vector is loaded into the pc. if no other exception is pending, the processor will resume normal execution at the new address in the pc. 5.5.1.3 exception stack frame. during exception processing, the most volatile por- tion of the current context is saved on the top of the supervisor stack. this context is orga- nized in a format called the exception stack frame. the exception stack frame always includes the contents of sr and pc at the time the excep- tion occurred. to support generic handlers, the processor also places the vector offset in the exception stack frame and marks the frame with a format code. the format field allows an rte instruction to identify stack information so that it can be properly restored. the general form of the exception stack frame is illustrated in figure 5-10. although some formats are peculiar to a particular m68000 family processor, format 0000 is always legal and always indicates that only the first four words of a frame are present. see 5.5.4 cpu32+ stack frames for a complete discussion of exception stack frames. figure 5-10. exception stack frame status register program counter low format vector offset other processor state information, depending on exception (0, 2, or 8 words) program counter high higher addresses sp stacking order 15 0
cpu32+ motorola mc68360 user? manual 5-39 5.5.1.4 multiple exceptions. each exception has been assigned a priority based on its relative importance to system operation. priority assignments are shown in table 5-17. group 0 exceptions have the highest priorities; group 4 exceptions have the lowest priorities. exception processing for exceptions that occur simultaneously is done by priority, from high- est to lowest. it is important to be aware of the difference between exception processing mode and exe- cution of an exception handler. each exception has an assigned vector that points to an associated handler routine. exception processing includes steps described in 5.5.1.2 exception processing sequence, but does not include execution of handler routines, which is done in normal mode. when the cpu32+ completes exception processing, it is ready to begin either exception processing for a pending exception or execution of a handler routine. priority assignment governs the order in which exception processing occurs, not the order in which exception handlers are executed. as a general rule, when simultaneous exceptions occur, the handler routines for lower pri- ority exceptions are executed before the handler routines for higher priority exceptions. for example, consider the arrival of an interrupt during execution of a trap instruction while tracing is enabled. trap exception processing (2) is done first, followed immediately by exception processing for the trace (4.1), and then by exception processing for the interrupt (4.3). each exception places a new context on the stack. when the processor resumes nor- mal instruction execution, it is vectored to the interrupt handler, which returns to the trace handler that returns to the trap handler. there are special cases to which the general rule does not apply. the reset exception will always be the first exception handled since reset clears all other exceptions. it is also pos- sible for high-priority exception processing to begin before low-priority exception processing is complete. for example, if a bus error occurs during trace exception processing, the bus error will be processed and handled before trace exception processing has completed. table 5-17. exception priority groups group/ priority exception and relative priority characteristics 0 reset aborts all processing (instruction or excep- tion); does not save old context. 1.1 1.2 address error bus error suspends processing (instruction or excep- tion); saves internal context. 2 bkpt#n, chk, chk2, division by zero, rte, trap#n, trapcc, trapv exception processing is a part of instruction execution. 3 illegal instruction, line a, unimplemented line f, privilege violation exception processing begins before instruc- tion execution. 4.1 4.2 4.3 trace hardware breakpoint interrupt exception processing begins when current in- struction or previous exception processing is complete.
cpu32+ 5-40 mc68360 user? manual motorola 5.5.2 processing of specific exceptions the following paragraphs provide details concerning sources of specific exceptions, how each arises, and how each is processed. 5.5.2.1 reset. assertion of reset by external hardware or assertion of the internal re- set signal by an internal module causes a reset exception. the reset exception has the highest priority of any exception. reset is used for system initialization and for recovery from catastrophic failure. when the reset exception is recognized, it aborts any processing in progress, and that processing cannot be recovered. reset performs the following opera- tions: 1. clears t0 and t1 in the sr to disable tracing 2. sets the s-bit in the sr to establish supervisor privilege 3. sets the interrupt priority mask to the highest priority level (%111) 4. initializes the vbr to zero ($00000000) 5. generates a vector number to reference the reset exception vector 6. loads the first long word of the vector into the interrupt sp 7. loads the second long word of the vector into the pc 8. fetches and initiates decode of the first instruction to be executed figure 5-11 is a flowchart of the reset exception after initial instruction prefetches, normal program execution begins at the address in the pc. the reset exception does not save the value of either the pc or the sr. if a bus error or address error occurs during reset exception processing, a double bus fault occurs, the processor halts, and the halt signal is asserted to indicate the halted condition. execution of the reset instruction does not cause a reset exception nor does it affect any internal cpu register. the sim60 registers and the module control register in each internal peripheral module (dma, timers, and serial modules) are not affected. all other internal peripheral module registers are reset the same as for a hardware reset. the external devices connected to the reset signal are reset at the completion of the reset instruction 5.5.2.2 bus error. a bus error exception occurs when an assertion of the berr signal is acknowledged. the berr signal can be asserted by one of three sources: 1. external logic by assertion of the berr input pin 2. direct assertion of the internal berr signal by an internal module 3. direct assertion of the internal berr signal by the on-chip hardware watchdog after detecting a no-response condition bus error exception processing begins when the processor attempts to use information from an aborted bus cycle.
cpu32+ motorola mc68360 user? manual 5-41 . figure 5-11. reset operation flowchart when the aborted bus cycle is an instruction prefetch, the processor will not initiate excep- tion processing unless the prefetched information is used. for example, if a branch instruc- tion flushes an aborted prefetch, that word is not accessed, and no exception occurs. when the aborted bus cycle is a data access, the processor initiates exception processing immediately, except in the case of released operand writes. released write bus errors are delayed until the next instruction boundary or until another operand access is attempted. exception processing for bus error exceptions follows the regular sequence, but context preservation is more involved than for other exceptions because a bus exception can be ini- entry fetch vector # 0 1 s 0 t0,t1 $7 i2:io $0 vbr fetch vector # 1 bus error otherwise (vector # 0) sp bus error prefetch 3 words bus error/ address error otherwise begin instruction execution exit (double bus fault) assert halt exit ? otherwise (vector # 1) pc ? ? ? ? ?
cpu32+ 5-42 mc68360 user? manual motorola tiated while an instruction is executing. several bus error stack format organizations are uti- lized to provide additional information regarding the nature of the fault. first, any register altered by a faulted-instruction ea calculation is restored to its initial value. then a special status word (ssw) is placed on the stack. the ssw contains specific infor- mation about the aborted access?ize, type of access (read or write), bus cycle type, and function code. finally, fault address, bus error exception vector number, pc value, and a copy of the sr are saved. if a bus error occurs during exception processing for a bus error, an address error, a reset, or while the processor is loading stack information during rte execution, the processor halts. this simplifies isolation of catastrophic system failure by preventing processor inter- action with stacks and memory. only assertion of reset can restart a halted processor. 5.5.2.3 address error. address error exceptions occur when the processor attempts to access an instruction, word operand, or long-word operand at an odd address. the effect is much the same as an internally generated bus error. the exception processing sequence is the same as that for bus error, except that the vector number refers to the address error exception vector. address error exception processing begins when the processor attempts to use information from the aborted bus cycle. if the aborted cycle is a data space access, exception process- ing begins when the processor attempts to use the data, except in the case of a released operand write. released write exceptions are delayed until the next instruction boundary or attempted operand access. an address exception on a branch to an odd address is delayed until the pc is changed. no exception occurs if the branch is not taken. in this case, the fault address and return pc value placed in the exception stack frame are the odd address, and the current instruction pc points to the instruction that caused the exception. if an address error occurs during exception processing for a bus error, another address error, or a reset, the processor halts. 5.5.2.4 instruction traps. traps are exceptions caused by instructions. they arise from either processor recognition of abnormal conditions during instruction execution or from use of specific trapping instructions. traps are generally used to handle abnormal con- ditions that arise in control routines. the trap instruction, which always forces an exception, is useful for implementing system calls for user programs. the trapcc, trapv, chk, and chk2 instructions force excep- tions when a program detects a run-time error. the divs and divu instructions force an exception if a division operation is attempted with a divisor of zero. exception processing for traps follows the regular sequence. if tracing is enabled when an instruction that causes a trap begins execution, a trace exception will be generated by the instruction, but the trap handler routine will not be traced. (the trap exception will be pro- cessed first, then the trace exception.)
cpu32+ motorola mc68360 user? manual 5-43 the vector number for the trap instruction is internally generated?art of the number comes from the instruction itself. the trap vector number, pc value, and a copy of the sr are saved on the supervisor stack. the saved pc value is the address of the instruction that follows the instruction that generated the trap. for all instruction traps other than trap, a pointer to the instruction causing the trap is also saved in the fifth and sixth words of the exception stack frame. 5.5.2.5 software breakpoints. to support hardware emulation, the cpu32+ must provide a means of inserting breakpoints into target code and of announcing when a break- point is reached. the mc68000 and mc68008 can detect an illegal instruction inserted at a breakpoint when the processor fetches from the illegal instruction exception vector location. since the vbr on the cpu32+ allows relocation of exception vectors, the exception vector address is not a reliable indication of a breakpoint. cpu32+ breakpoint support is provided by extending the function of a set of illegal instructions ($4848?484f). when a breakpoint instruction is executed, the cpu32+ performs a read from cpu space $0, at a location corresponding to the breakpoint number. if this bus cycle is terminated by berr , the processor performs illegal instruction exception processing. if the bus cycle is terminated by dsackx , the processor uses the data returned to replace the breakpoint in the instruction pipeline and begins execution of that instruction. see section 4 bus opera- tion for a description of cpu space operations. 5.5.2.6 hardware breakpoints. the cpu32+ recognizes hardware breakpoint requests. hardware breakpoint requests do not force immediate exception processing, but are left pending. an instruction breakpoint is not made pending until the instruction corre- sponding to the request is executed. a pending breakpoint can be acknowledged between instructions or at the end of exception processing. to acknowledge a breakpoint, the cpu performs a read from cpu space $0 at location $1e (see section 4 bus operation). if the bus cycle terminates normally, instruction execution continues with the next instruction as if no breakpoint request occurred. if the bus cycle is terminated by berr , the cpu begins exception processing. data returned during this bus cycle is ignored. exception processing follows the regular sequence. vector number 12 (offset $30) is inter- nally generated. the pc of the executing instruction, the pc of the next instruction to be exe- cuted, and a copy of the sr are saved on the supervisor stack. 5.5.2.7 format error. the processor checks certain data values for control operations. the validity of the stack format code and, in the case of a bus cycle fault format, the version number of the processor that generated the frame are checked during execution of the rte instruction. this check ensures that the program does not make erroneous assumptions about information in the stack frame. if the format of the control data is improper, the processor generates a format error excep- tion. this exception saves a four-word format exception frame and then vectors through vec-
cpu32+ 5-44 mc68360 user? manual motorola tor table entry number 14. the stacked pc is the address of the rte instruction that discovered the format error. 5.5.2.8 illegal or unimplemented instructions. an instruction is illegal if it con- tains a word bit pattern that does not correspond to the bit pattern of the first word of a legal cpu32+ instruction, if it is a movec instruction that contains an undefined register specifi- cation field in the first extension word, or if it contains an indexed addressing mode exten- sion word with bits 5? = 00 or bits 3? ? 0000. if an illegal instruction is fetched during instruction execution, an illegal instruction exception occurs. this facility allows the operating system to detect program errors or to emulate instructions in software. word patterns with bits 15?2 = 1010 (referred to as a-line opcodes) are unimplemented instructions. a separate exception vector (vector 10, offset $28) is given to unimplemented instructions to permit efficient emulation. word patterns with bits 15?2 = 1111 (referred to as f-line opcodes) are used for m68000 family instruction set extensions. they can generate an unimplemented instruction excep- tion caused by the first extension word of the instruction or by the addressing mode exten- sion word. a separate f-line emulation vector (vector 11, offset $2c) is used for the exception vector. all unimplemented instructions are reserved for use by motorola for enhancements and extensions to the basic m68000 architecture. opcode pattern $4afc is defined to be illegal on all m68000 family members. those customers requiring the use of an unimplemented opcode for synthesis of "custom instructions," operating system calls, etc., should use this opcode. exception processing for illegal and unimplemented instructions is similar to that for traps. the instruction is fetched and decoding is attempted. when the processor determines that execution of an illegal instruction is being attempted, exception processing begins. no reg- isters are altered. exception processing follows the regular sequence. the vector number is generated to refer to the illegal instruction vector or in the case of an unimplemented instruction, to the corre- sponding emulation vector. the illegal instruction vector number, current pc, and a copy of the sr are saved on the supervisor stack, with the saved value of the pc being the address of the illegal or unimplemented instruction. 5.5.2.9 privilege violations. to provide system security, certain instructions can be executed only at the supervisor access level. an attempt to execute one of these instructions at the user level will cause an exception. the privileged exceptions are as follows: and immediate to sr eor immediate to sr lpstop move from sr
cpu32+ motorola mc68360 user? manual 5-45 move to sr move usp movec moves or immediate to sr reset rte stop exception processing for privilege violations is nearly identical to that for illegal instructions. the instruction is fetched and decoded. if the processor determines that a privilege violation has occurred, exception processing begins before instruction execution. exception processing follows the regular sequence. the vector number (8) is generated to reference the privilege violation vector. privilege violation vector offset, current pc, and sr are saved on the supervisor stack. the saved pc value is the address of the first word of the instruction causing the privilege violation. 5.5.2.10 tracing. to aid in program development, m68000 processors include a facility to allow tracing of instruction execution. cpu32+ tracing also has the ability to trap on changes in program flow. in trace mode, a trace exception is generated after each instruc- tion executes, allowing a debugging program to monitor the execution of a program under test. the t1 and t0 bits in the supervisor portion of the sr are used to control tracing. when t1?0 = 00, tracing is disabled, and instruction execution proceeds normally (see table 5-18). when t1?0 = 01 at the beginning of instruction execution, a trace exception will be gener- ated if the pc changes sequence during execution. all branches, jumps, subroutine calls, returns, and sr manipulations can be traced in this way. no exception occurs if a branch is not taken. when t1?0 = 10 at the beginning of instruction execution, a trace exception will be gener- ated when execution is complete. if the instruction is not executed, either because an inter- rupt is taken or because the instruction is illegal, unimplemented, or privileged, an exception is not generated. table 5-18. tracing control t1 t0 tracing function 0 0 no tracing 0 1 trace on change of flow 1 0 trace on instruction execution 1 1 undefined; reserved
cpu32+ 5-46 mc68360 user? manual motorola at the present time, t1?0 = 11 is an undefined condition. it is reserved by motorola for future use. exception processing for trace starts at the end of normal processing for the traced instruc- tion and before the start of the next instruction. exception processing follows the regular sequence; tracing is disabled so that the trace exception itself is not traced. a vector number is generated to reference the trace exception vector. the address of the instruction that caused the trace exception, the trace exception vector offset, the current pc, and a copy of the sr are saved on the supervisor stack. the saved value of the pc is the address of the next instruction to be executed. a trace exception can be viewed as an extension to the function of any instruction. if a trace exception is generated by an instruction, the execution of that instruction is not complete until the trace exception processing associated with it is also complete. if an instruction is aborted by a bus error or address error exception, trace exception pro- cessing is deferred until the suspended instruction is restarted and completed normally. an rte from a bus error or address error will not be traced because of the possibility of con- tinuing the instruction from the fault. if an instruction is executed and an interrupt is pending on completion, the trace exception is processed before the interrupt exception. if an instruction forces an exception, the forced exception is processed before the trace exception. if an instruction is executed and a breakpoint is pending upon completion of the instruction, the trace exception is processed before the breakpoint. if an attempt is made to execute an illegal, unimplemented, or privileged instruction while tracing is enabled, no trace exception will occur because the instruction is not executed. this is particularly important to an emulation routine that performs an instruction function, adjusts the stacked pc to beyond the unimplemented instruction, and then returns. the sr on the stack must be checked to determine if tracing is on before the return is executed. if tracing is on, trace exception processing must be emulated so that the trace exception handler can account for the emulated instruction. tracing also affects normal operation of the stop and lpstop instructions. if either instruction begins execution with t1 set, a trace exception will be taken after the instruction loads the sr. upon return from the trace handler routine, execution will continue with the instruction following stop (lpstop), and the processor will not enter the stopped condi- tion. 5.5.2.11 interrupts. there are seven levels of interrupt priority and 192 assignable interrupt vectors within each exception vector table. careful use of multiple vector tables and hardware chaining will permit a virtually unlimited number of peripherals to interrupt the pro- cessor.
cpu32+ motorola mc68360 user? manual 5-47 interrupt recognition and subsequent processing are based on internal interrupt request sig- nals (irq7 ?rq1 ) and the current priority set in sr priority mask i2?0. interrupt request level 0 (irq7 ?rq1 negated) indicates that no service is requested. when an interrupt of level 1 through 6 is requested via irq6 ?rq1 , the processor compares the request level with the interrupt mask to determine whether the interrupt should be processed. interrupt requests are inhibited for all priority levels less than or equal to the current priority. level 7 interrupts are nonmaskable. irq7 ?rq1 are synchronized and debounced by input circuitry on two consecutive rising edges of the processor clock. interrupt requests do not force immediate exception processing, but are left pending. a pending interrupt is detected between instructions or at the end of exception processing all interrupt requests must be held asserted until they are acknowledged by the cpu. if the priority of the interrupt is greater than the current priority level, exception processing begins. exception processing occurs as follows. first, the processor makes an internal copy of the sr. after the copy is made, the processor state bits in the sr are changed?he s-bit is set, establishing supervisor access level, and bits t1 and t0 are cleared, disabling tracing. priority level is then set to the level of the interrupt, and the processor fetches a vec- tor number from the interrupting device (cpu space $f). the fetch bus cycle is classified as an interrupt acknowledge, and the encoded level number of the interrupt is placed on the address bus. if an interrupting device requests automatic vectoring, the processor generates a vector number (25 to 31) determined by the interrupt level number. if the response to the interrupt acknowledge bus cycle is a bus error, the interrupt is taken to be spurious, and the spurious interrupt vector number (24) is generated. the exception vector number, pc, and sr are saved on the supervisor stack. the saved value of the pc is the address of the instruction that would have executed if the interrupt had not occurred. priority level 7 interrupt is a special case. level 7 interrupts are nonmaskable interrupts (nmi). irq7 is a level sensitive input and must remain low until cpu32+ returns a n interrupt acknowledge cycle for level 7 interrupt. many m68000 peripherals provide for programmable interrupt vector numbers to be used in the system interrupt request/acknowledge mechanism. if the vector number is not initialized after reset and if the peripheral must acknowledge an interrupt request, the peripheral should return the uninitialized interrupt vector number (15). see section 4 bus operation for detailed information on interrupt acknowledge cycles. 5.5.2.12 return from exception. when exception stacking operations for all pend- ing exceptions are complete, the processor begins execution of the handler for the last exception processed. after the exception handler has executed, the processor must restore
cpu32+ 5-48 mc68360 user? manual motorola the system context in existence prior to the exception. the rte instruction is designed to accomplish this task. when rte is executed, the processor examines the stack frame on top of the supervisor stack to determine if it is valid and determines what type of context restoration must be per- formed. see 5.5.4 cpu32+ stack frames for a description of stack frames. for a normal four-word frame, the processor updates the sr and pc with data pulled from the stack, increments the ssp by 8, and resumes normal instruction execution. for a six- word frame, the sr and pc are updated from the stack, the active ssp is incremented by 12, and normal instruction execution resumes. for a bus fault frame, the format value on the stack is first checked for validity. in addition, the version number on the stack must match the version number of the processor that is attempting to read the stack frame. the version number is located in the most significant byte (bits 15?) of the internal register word at location sp + $14 in the stack frame. the validity check ensures that stack frame data will be properly interpreted in multiprocessor systems. if a frame is invalid, a format error exception is taken. if it is inaccessible, a bus error excep- tion is taken. otherwise, the processor reads the entire frame into the proper internal regis- ters, de-allocates the stack (12 words), and resumes normal processing. bus error frames for faults during exception processing require the rte instruction to rewrite the faulted stack frame. if an error occurs during any of the bus cycles required by rewrite, the processor halts. if a format error occurs during rte execution, the processor creates a normal four-word fault stack frame below the frame that it was attempting to use. if a bus error occurs, a bus- error stack frame will be created. the faulty stack frame remains intact, so that it may be examined and repaired by an exception handler or used by a different type of processor (e.g., mc68010, mc68020, or future m68000 processor) in a multiprocessor system. 5.5.3 fault recovery there are four phases of recovery from a fault: recognizing the fault, saving the processor state, repairing the fault (if possible), and restoring the processor state. saving and restoring the processor state are described in the following paragraphs. the stack contents are identified by the special status word (ssw). in addition to identifying the fault type represented by the stack frame, the ssw contains the internal processor state corresponding to the fault. 1514131211109876543210 tp mv szc1 tr b1 b0 rr rm in rw szc0 siz func
cpu32+ motorola mc68360 user? manual 5-49 tp?err frame type the tp field defines the class of the faulted bus operation. two bus error exception frame types are defined. one is for faults on prefetch and operand accesses, and the other is for faults during exception frame stacking. 0 = operand or prefetch bus fault 1 = exception processing bus fault mv?ovem in progress mv is set when the operand transfer portion of the movem instruction is in progress at the time of a bus fault. if a prefetch bus fault occurs while prefetching the movem opcode and extension word, both the mv and in bits will be set. 0 = movem was not in progress when fault occurred 1 = movem was in progress when fault occurred szc1,scz0?riginal operand size the szc1,szc0 field specifies the size of the original bus cycle (i.e., the size bits of the first cycle, when a transaction is divided into two or three cycles due to bus size or operand address). 00 = original operand size was long word 01 = original operand size was byte 10 = original operand size was word 11 = unused, reserved tr?race pending tr indicates that a trace exception was pending when a bus error exception was pro- cessed. the instruction that generated the trace will not be restarted upon return from the exception handler. this includes movem and released write bus errors indicated by the assertion of either mv or rr in the ssw. 0 = trace not pending 1 = trace pending b1?reakpoint channel 1 pending b1 indicates that a breakpoint exception was pending on channel 1 (external breakpoint source) when a bus error exception was processed. pending breakpoint status is stacked, regardless of the type of bus error exception. 0 = breakpoint not pending 1 = breakpoint pending b0?reakpoint channel 0 pending b0 indicates that a breakpoint exception was pending on channel 0 (internal breakpoint source) when the bus error exception was processed. pending breakpoint status is stacked, regardless of the type of bus error exception. 0 = breakpoint not pending 1 = breakpoint pending
cpu32+ 5-50 mc68360 user? manual motorola rr?erun write cycle after rte rr will be set if the faulted bus cycle was a released write. a released write is one that is overlapped. if the write is completed (rerun) in the exception handler, the rr bit should be cleared before executing rte. the bus cycle will be rerun if the rr bit is set upon re- turn from the exception handler. 0 = faulted cycle was read, rmw, or unreleased write 1 = faulted cycle was a released write rm?aulted cycle was read-modify-write faulted rmw bus cycles set the rm bit. rm is ignored during unstacking. 0 = faulted cycle was non-rmw cycle 1 = faulted cycle was either the read or write of an rmw cycle in?nstruction/other instruction prefetch faults are distinguished from operand (both read and write) faults by the in bit. if in is cleared, the error was on an operand cycle; if in is set, the error was on an instruction prefetch. in is ignored during unstacking. 0 = operand 1 = prefetch rw?ead/write of faulted bus cycle read and write bus cycles are distinguished by the rw bit. read bus cycles will set this bit, and write bus cycles will clear it. rw is reloaded into the bus controller if the rr bit is set during unstacking. 0 = faulted cycle was an operand write 1 = faulted cycle was a prefetch or operand read siz?emaining size of faulted bus cycle the siz field shows operand size remaining when a fault was detected. this field does not indicate the initial size of the operand, nor does it necessarily indicate the proper sta- tus of a dynamically sized bus cycle. dynamic sizing occurs on the external bus and is transparent to the cpu. byte size is shown only when the original operand was a byte. the field is reloaded into the bus controller if the rr bit is set during unstacking. the siz field is encoded as follows: 00 = long word 01 = byte 10 = word 11 = unused, reserved func?unction code of faulted bus cycle the function code for the faulted cycle is stacked in the func field of the ssw, which is a copy of fc2?c0 for the faulted bus cycle. this field is reloaded into the bus controller if the rr bit is set during unstacking. all unused bits are stacked as zeros and are ignored during unstacking. further discussion of the ssw is included in 5.5.3.1 types of faults.
cpu32+ motorola mc68360 user? manual 5-51 5.5.3.1 types of faults. an efficient implementation of instruction restart dictates that faults on some bus cycles be treated differently than faults on other bus cycles. the cpu32+ defines four fault types: released write faults, faults during exception processing, faults dur- ing movem operand transfer, and faults on any other bus cycle. 5.5.3.1.1 type i?eleased write faults. cpu32+ instruction pipelining can cause a final instruction write to overlap the execution of a following instruction. a write that is overlapped is called a released write. a released write fault occurs when a bus error or some other fault occurs on the released write. released write faults are taken at the next instruction boundary. the stacked pc is that of the next unexecuted instruction. if a subsequent instruction attempts an operand access while a released write fault is pending, the instruction is aborted and the write fault is acknowledged. this action prevents the instruction from using stale data. the ssw for a released write fault contains the following bit pattern: tr , b1, and b0 are set if the corresponding exception is pending when the bus error excep- tion is taken. status regarding the faulted bus cycle is reflected in the szcx, siz, and func fields. the remainder of the stack contains the pc of the next unexecuted instruction, the current sr, the address of the faulted memory location, and the contents of the data buffer that was to be written to memory. this data is written on the stack in the format depicted in figure 5- 15. when a released write fault exception handler executes, the machine will complete the faulted write and then continue executing instructions wherever the pc indicates. 5.5.3.1.2 type ii?refetch, operand, rmw, and movep faults. the majority of bus error exceptions are included in this category?ll instruction prefetches, all operand reads, all rmw cycles, and all operand accesses resulting from execution of movep (except the last write of a movep rn, ea or the last write of movem, which are type i faults). the tas, movep, and movem instructions account for all operand writes not considered released write faults. all type ii faults cause an immediate exception that aborts the current instruction. any reg- isters that were altered as the result of an ea calculation (i.e., postincrement or predecre- ment) are restored prior to processing the bus cycle fault. the ssw for faults in this category contains the following bit pattern: the trace pending bit is always cleared since the instruction will be restarted upon return from the handler. saving a pending exception on the stack causes a trace exception to be 15141312111098765432 0 0 0 szc1 tr b1 b0 1000 szc0 siz func 15141312111098765432 0 0 0 szc1 0 b1 b0 0 rm in rw szc0 siz func
cpu32+ 5-52 mc68360 user? manual motorola taken prior to restarting the instruction. if the exception handler does not alter the stacked sr trace bits, the trace is requeued when the instruction is started. the breakpoint pending bits are stacked in the ssw, even though the instruction is restarted upon return from the handler. this avoids problems with bus state analyzer equipment that has been programmed to breakpoint only the first access to a specific location or to count accesses to that location. if this response is not desired, the exception handler can clear the bits before return. the rm, in, rw, szcx, func, and siz fields reflect the type of bus cycle that caused the fault. if the bus cycle was an rmw, the rm bit will be set, and the rw bit will show whether the fault was on a read or write. 5.5.3.1.3 type iii?aults during movem operand transfer. bus faults that occur as a result of movem operand transfer are classified as type iii faults. movem instruction prefetch faults are type ii faults. type iii faults cause an immediate exception that aborts the current instruction. registers altered during execution of the faulted instruction are not restored prior to execution of the fault handler. this includes any register predecremented as a result of the effective address calculation or any register overwritten during instruction execution. since postincremented registers are not updated until the end of an instruction, the register retains its pre-instruction value unless overwritten by operand movement. the ssw for faults in this category contains the following bit pattern: mv is set, indicating that movem should be continued from the point where the fault occurred upon return from the exception handler. tr, b1, and b0 are set if a corresponding exception is pending when the bus error exception is taken. in is set if a bus fault occurs while prefetching an opcode or an extension word during instruction restart. rw, szcx, siz, and func all reflect the type of bus cycle that caused the fault. all write faults have the rr bit set to indicate that the write should be rerun upon return from the exception handler. the remainder of the stack frame contains sufficient information to continue movem with operand transfer following a faulted transfer. the address of the next operand to be trans- ferred, incremented or decremented by operand size, is stored in the faulted address loca- tion ($08). the stacked transfer counter is set to 16 minus the number of transfers attempted (including the faulted cycle). refer to figure 5-12 for the stacking format. 5.5.3.1.4 type iv?aults during exception processing. the fourth type of fault occurs during exception processing. if this exception is a second address or bus error, the machine halts in the double bus fault condition. however, if the exception is one that causes a four- or six-word stack frame to be written, a bus cycle fault frame is written below the faulted exception stack frame. 15141312111098765432 0 0 1 szc1 tr b1 b0 rr 0 in rw szc0 siz func
cpu32+ motorola mc68360 user? manual 5-53 the ssw for a fault within an exception contains the following bit pattern: tr, b1, and b0 are set if a corresponding exception is pending when the bus error exception is taken. the contents of the faulted exception stack frame are included in the bus fault stack frame. the pre-exception sr and the format/vector word of the faulted frame are stacked. the type of exception can be determined from the format/vector word. if the faulted exception stack frame contains six words, the pc of the instruction that caused the initial exception is also stacked. this data is placed on the stack in the format shown in figure 5-13. the return address from the initial exception is stacked for rte . 5.5.3.2 correcting a fault. there are two ways to complete a faulted released write bus cycle. the first is to use a software handler. the second is to rerun the bus cycle via rte. type ii fault handlers must terminate with rte, but specific requirements must also be met before an instruction is restarted. there are three varieties of type iii operand fault recovery. the first is completion of an instruction in software. the second is conversion to type ii with restart via rte. the third is continuation from the fault via rte. 5.5.3.2.1 type i?ompleting released writes via software. to complete a bus cycle in software, a handler must first read the ssw function code field to determine the appropriate address space, access the fault address pointer on the stack, and then transfer data from the stacked image of the output buffer to the fault address. if the cpu32+ is configured to 16-bit operation, rather than 32-bit operation, on the internal data bus, long operands require two bus accesses. a fault during the second access of a long operand causes the szcx bits in the ssw to be set to long word. the siz field indicates remaining operand size. if operand coherency is important, the complete operand must be rewritten. after a long operand is rewritten, the rr bit must be cleared. failure to clear the rr bit can cause the rte instruction to rerun the bus cycle. following rewrite, it is not nec- essary to adjust the pc (or other stack contents) before executing rte. 5.5.3.2.2 type i?ompleting released writes via rte. an exception handler can use the rte instruction to complete a faulted bus cycle. when rte executes, the fault address, data output buffer, pc, and sr are restored from the stack. any pending breakpoint or trace exceptions, as indicated by tr, b1, and b0 in the stacked ssw, are requeued during ssw restoration. the rr bit in the ssw is checked during the unstacking operation; if it is set, the rw, func, and siz fields are restored and the released write cycle is rerun. to maintain long-word operand coherence, stack contents must be adjusted prior to the rte execution. the fault address must be decremented by 2 if the szcx bits are set to long 15141312111098765432 0 1 0 szc1 tr b1 b0 0001 szc0 siz func
cpu32+ 5-54 mc68360 user? manual motorola word and siz indicates a remaining byte or word. siz must be set to long. all other fields should be left unchanged. the bus controller uses the modified fault address and siz field to rerun the complete released write cycle. manipulating the stacked ssw can cause unpredictable results because rte checks only the rr bit to determine if a bus cycle must be rerun. inadvertent alteration of the control bits could cause the bus cycle to be a read instead of a write or could cause access to a different address space than the original bus cycle. if the rerun bus cycle is a read, returned data will be ignored. 5.5.3.2.3 type ii?orrecting faults via rte. instructions aborted because of a type ii fault are restarted upon return from the exception handler. a fault handler must establish safe restart conditions. if a fault is caused by a nonresident page in a demand-paged virtual memory configuration, the fault address must be read from the stack, and the appropriate page retrieved. an rte instruction terminates the exception handler. after unstacking the machine state, the instruction is refetched and restarted. 5.5.3.2.4 type iii?orrecting faults via software. sufficient information is contained in the stack frame to complete movem in software. after the cause of the fault is corrected, the faulted bus cycle must be rerun. perform the following procedures to complete an instruction through software: a. set up for rerun 1. read the movem opcode and extension from locations pointed to by stack frame pc and pc + 2. the ea need not be recalculated since the next operand address is saved in the stack frame. however, the opcode ea field must be examined to deter- mine how to update the address register and pc when the instruction is complete. 2. adjust the mask to account for operands already transferred. subtract the stacked op- erand transfer count from 16 to obtain the number of operands transferred. scan the mask using this count value. each time a set bit is found, clear it and decrement the counter. when the count is zero, the mask is ready for use. 3. adjust the operand address. if the predecrement addressing mode is in effect, subtract the operand size from the stacked value; otherwise, add the operand size to the stacked value. b. rerun instruction 1. scan the mask for set bits. read/write the selected register from/to the operand ad- dress as each bit is found. 2. as each operand is transferred, clear the mask bit and increment (decrement) the op- erand address. when all bits in the mask are cleared, all operands have been trans- ferred. 3. if the addressing mode is predecrement or postincrement, update the register to com- plete the execution of the instruction. 4. if tr is set in the stacked ssw, create a six-word stack frame and execute the trace handler. if either b1 or b0 is set in the ssw, create another six-word stack frame and execute the hardware breakpoint handler.
cpu32+ motorola mc68360 user? manual 5-55 5. de-allocate the stack and return control to the faulted program. 5.5.3.2.5 type iii?orrecting faults by conversion and restart. in some situations it may be necessary to rerun all the operand transfers for a faulted instruction rather than con- tinue from a faulted operand. clearing the mv bit in the stacked ssw converts a type iii fault into a type ii fault. consequently, movem, like all other type ii exceptions, will be restarted upon return from the exception handler. when a fault occurs after an operand has trans- ferred, that transfer is not "undone". however, these memory locations are accessed a sec- ond time when the instruction is restarted. if a register used in an ea calculation is overwritten before a fault occurs, an incorrect ea is calculated upon instruction restart. 5.5.3.2.6 type iii?orrecting faults via rte. the preferred method of movem bus fault recovery is to correct the cause of the fault and then execute an rte instruction without altering the stack contents. the rte recognizes that movem was in progress when a fault occurred, restores the appropriate machine state, refetches the instruction, repeats the faulted transfer, and con- tinues the instruction. movem is the only instruction continued upon return from an exception handler. although the instruction is refetched, the ea is not recalculated, and the mask is rescanned the same number of times as before the fault. modifying the code prior to rte can cause unexpected results. 5.5.3.2.7 type iv?orrecting faults via software. bus error exceptions can occur dur- ing exception processing while the processor is fetching an exception vector or while it is stacking. the same stack frame and ssw are used in both cases, but each has a distinct fault address. the stacked faulted exception format/vector word identifies the type of faulted exception and the contents of the remainder of the frame. a fault address corresponding to the vector specified in the stacked format/vector word indicates that the processor could not obtain the address of the exception handler. a bus error exception handler should execute rte after correcting a fault. rte restores the internal machine state, fetches the address of the original exception handler, recreates the original exception stack frame, and resumes execution at the exception handler address. if the fault is intractable, the exception handler should rewrite the faulted exception stack frame at sp + $14 + $06 and then jump directly to the original exception handler. the stack frame can be generated from the information in the bus error frame: the pre-exception sr (sp + $0c), the format/vector word (sp + $0e), and, if the frame being written is a six-word frame, the pc of the instruction causing the exception (sp + $10). the return pc value is available at sp + $02. a stacked fault address equal to the current sp may indicate that, although the first excep- tion received a bus error while stacking, the bus error exception stacking successfully com- pleted. this occurrence is extremely improbable, but the cpu32+ supports recovery from it. once the exception handler determines that the fault has been corrected, recovery can pro- ceed as described previously. if the fault cannot be corrected, move the supervisor stack to another area of memory, copy all valid stack frames to the new stack, create a faulted
cpu32+ 5-56 mc68360 user? manual motorola exception frame on top of the stack, and resume execution at the exception handler address. 5.5.4 cpu32+ stack frames the cpu32+ generates three different stack frames: four-word frames, six-word frames, and twelve-word bus error frames. 5.5.4.1 four-word stack frame. this stack frame is created by interrupt, format error, trap #n, illegal instruction, a-line and f-line emulator trap, and privilege violation exceptions. depending on the exception type, the pc value is either the address of the next instruction to be executed or the address of the instruction that caused the exception (see figure 5-12). 5.5.4.2 six-word stack frame. this stack frame (see figure 5-13) is created by instruction-related traps, which include chk, chk2, trapcc, trapv, and divide-by-zero, and by trace exceptions. the faulted instruction pc value is the address of the instruction that caused the exception. the next pc value (the address to which rte returns) is the address of the next instruction to be executed. hardware breakpoints also utilize this format. the faulted instruction pc value is the address of the instruction executing when the breakpoint was sensed. usually this is the address of the instruction that caused the breakpoint, but, because released writes can overlap follow- ing instructions, the faulted instruction pc may point to an instruction following the instruc- tion that caused the breakpoint. the address to which rte returns is the address of the next instruction to be executed. 5.5.4.3 bus error stack frame. this stack frame is created when a bus cycle fault is detected. the cpu32+ bus error stack frame differs significantly from the equivalent stack 15 0 sp status register +$02 program counter high program counter low +$06 0000 vector offset figure 5-12. format $0?our-word stack frame 15 0 sp status register +$02 next instruction program counter high next instruction program counter low +$06 0010 vector offset +$08 faulted instruction program counter high faulted instruction program counter low figure 5-13. format $2?ix-word stack frame
cpu32+ motorola mc68360 user? manual 5-57 frames of other m68000 family members. the only internal machine state required in the cpu32+ stack frame is the bus controller state at the time of the error and a single register. bus operation in progress at the time of a fault is conveyed by the ssw. the bus error stack frame is 12 words in length. there are three variations of the frame, each distinguished by different values in the ssw tp and mv fields. an internal transfer count register appears at location sp + $14 in all bus error stack frames. the register contains an 8-bit microcode revision number and, for type iii faults, an 8-bit transfer count. register format is shown in figure 5-14. the microcode revision number is checked before a bus error stack frame is restored via rte. in a multiprocessor system, this check ensures that a processor using stacked infor- mation is at the same revision level as the processor that created it. the transfer count is ignored unless the mv bit in the stacked ssw is set. if the mv bit is set, the least significant byte of the internal register is reloaded into the movem transfer counter during rte execution. for faults occurring during normal instruction execution (both prefetches and non-movem operand accesses), ssw tp,mv = 00. stack frame format is shown in figure 5-15. faults that occur during the operand portion of the movem instruction are identified by ssw tp,mv = 01. stack frame format is shown in figure 5-16. when a bus error occurs during exception processing, ssw tp,mv = 10. the frame shown in figure 5-17 is written below the faulting frame. stacking begins at the address pointed to by sp ?6 (sp value is the value before initial stacking on the faulted frame). the frame can have either four or six words, depending on the type of error. four-word stack frames do not include the faulted instruction pc. (the internal transfer count register is located at sp + $10 and the ssw is located at sp + $12.) the fault address of a dynamically sized bus cycle is the address of the upper byte, regard- less of the byte that caused the error. 1514131211109876543210 tp mv szc1 tr b1 b0 rr rm in rw szc0 siz func 15 8 7 0 microcode revision number transfer count figure 5-14. internal transfer count register
cpu32+ 5-58 mc68360 user? manual motorola 15 0 sp status register +$02 return program counter high return program counter low +$06 1100 vector offset +$08 faulted address high faulted address low +$0c dbuf high dbuf low +$10 current instruction program counter high current instruction program counter low +$14 internal transfer count register +$16 0 0 special status word figure 5-15. format $c?err stack for prefetches and operands 15 0 sp status register +$02 return program counter high return program counter low +$06 1100 vector offset +$08 faulted address high faulted address low +$0c dbuf high dbuf low +$10 current instruction program counter high current instruction program counter low +$14 internal transfer count register +$16 0 1 special status word figure 5-16. format $c?err stack on movem operand 15 0 sp status register +$02 next instruction program counter high next instruction program counter low +$06 1100 vector offset +$08 faulted address high faulted address low +$0c pre-exception status register faulted exception format/vector word +$10 faulted instruction program counter high (six word frame only) faulted instruction program counter low (six word frame only) +$14 internal transfer count register +$16 1 0 special status word figure 5-17. format $c?our- and six-word berr stack
cpu32+ motorola mc68360 user? manual 5-59 5.6 development support all m68000 family members have the following special features that facilitate applications development. trace on instruction execution?ll m68000 processors include an instruction-by-instruc- tion tracing facility to aid in program development. the mc68020, mc68030, and cpu32+ can also trace those instructions that change program flow. in trace mode, an exception is generated after each instruction is executed, allowing a debugger program to monitor exe- cution of a program under test. see 5.5.2.10 tracing for more information. breakpoint instruction?n emulator can insert software breakpoints into target code to indi- cate when a breakpoint occurs. on the mc68010, mc68020, mc68030, and cpu32+, this function is provided via illegal instructions ($4848?484f) that serve as breakpoint instruc- tions. see 5.5.2.5 software breakpoints for more information. unimplemented instruction emulation?hen an attempt is made to execute an illegal instruction, an illegal instruction exception occurs. unimplemented instructions (f-line, a- line) utilize separate exception vectors to permit efficient emulation of unimplemented instructions in software. see 5.5.2.8 illegal or unimplemented instructions for more informa- tion. 5.6.1 cpu32+ integrated development support in addition to standard mc68000 family capabilities, the cpu32+ has features to support advanced integrated system development. these features include background debug mode, deterministic opcode tracking, hardware breakpoints, and internal visibility in a sin- gle-chip environment. 5.6.1.1 background debug mode (bdm) overview. microprocessor systems generally provide a debugger, implemented in software, for system analysis at the lowest level. the bdm on the cpu32+ is unique because the debugger is implemented in cpu microcode. bdm incorporates a full set of debug options?egisters can be viewed and/or altered, mem- ory can be read or written, and test features can be invoked. a resident debugger simplifies implementation of an in-circuit emulator. in a common setup (see figure 5-18), emulator hardware replaces the target system processor. a complex, expensive pod-and-cable interface provides a communication path between target system and emulator. figure 5-18. in-circuit emulator configuration in-circuit emulator target mcu target system
cpu32+ 5-60 mc68360 user? manual motorola by contrast, an integrated debugger supports use of a bus state analyzer (bsa) for in-circuit emulation. the processor remains in the target system (see figure 5-19), and the interface is simplified. the bsa monitors target processor operation and the on-chip debugger con- trols the operating environment. emulation is much closer to target hardware; thus, many interfacing problems (i.e., limitations on high-frequency operation, ac and dc parametric mismatches, and restrictions on cable length) are minimized. figure 5-19. bus state analyzer configuration 5.6.1.2 deterministic opcode tracking overview. cpu32+ function code out- puts are augmented by three supplementary signals that monitor the instruction pipeline. the ifetch output signal identifies bus cycles in which data is loaded into the pipeline and signals pipeline flushes. the ipipe1 , ipipe0 output signals indicate when each mid-instruc- tion pipeline advance occurs and when instruction execution begins. these signals allow a bsa to synchronize with instruction stream activity. refer to 5.6.3 deterministic opcode tracking for complete information. 5.6.1.3 on-chip hardware breakpoint overview. an external breakpoint input and an on-chip hardware breakpoint capability permit breakpoint trap on any memory access. off-chip address comparators will not detect breakpoints on internal accesses unless show cycles are enabled. breakpoints on prefetched instructions, which are flushed from the pipeline before execution, are not acknowledged, but operand breakpoints are always acknowledged. acknowledged breakpoints can initiate either exception processing or bdm. see 5.5.2.6 hardware breakpoints for more information. 5.6.2 background debug mode bdm is an alternate cpu32+ operating mode. during bdm, normal instruction execution is suspended, and special microcode performs debugging functions under external control. figure 5-20 is a bdm block diagram. bdm can be initiated in several ways?y externally generated breakpoints, by internal peripheral breakpoints, by the background instruction (bgnd), or by catastrophic exception conditions. while in bdm, the cpu32+ ceases to fetch instructions via the parallel bus and communicates with the development system via a dedicated, high-speed, spi-type serial command interface. 5.6.2.1 enabling bdm. accidentally entering bdm in a nondevelopment environment could lock up the cpu32+ since the serial command interface would probably not be avail- able. for this reason, bdm is enabled during reset via the bkpt signal. target system target mcu bus state analyzer
cpu32+ motorola mc68360 user? manual 5-61 bdm operation is enabled when bkpt is asserted (low) at the rising edge of reset . bdm remains enabled until the next system reset. a high bkpt on the trailing edge of reset disables bdm. bkpt is relatched on each rising transition of reset . bkpt is synchronized internally and must be held low for at least two clock(four clocks for resets )cycles prior to negation of reseth. figure 5-20. bdm block diagram bdm enable logic must be designed with special care. if hold time on bkpt (after the trailing edge of reset ) extends into the first bus cycle following reset, this bus cycle could be tagged with a breakpoint. refer to section 4 bus operation for timing information. 5.6.2.2 bdm sources. when bdm is enabled, any of several sources can cause the tran- sition from normal mode to bdm. these sources include external bkpt hardware, the bgnd instruction, a double bus fault, and internal peripheral breakpoints. if bdm is not enabled when an exception condition occurs, the exception is processed normally. table 5- 19 summarizes the processing of each source for both enabled and disabled cases. note that the bkpt instruction never causes a transition into bdm. table 5-19. bdm source summary source bdm enabled bdm disabled bkpt background breakpoint exception double bus fault background halted bgnd instruction background illegal instruction bkpt instruction opcode substitution/ illegal instruction opcode substitution/ illegal instruction sequencer microcode serial interface bus control irc berr bkpt execution unit ipipe/dso ifetch/dsi data bus berr bkpt/dsclk address bus irb berr bkpt ir berr bkpt freeze
cpu32+ 5-62 mc68360 user? manual motorola 5.6.2.2.1 external bkpt signal. once enabled, bdm is initiated whenever assertion of bkpt is acknowledged. if bdm is disabled, a breakpoint exception (vector $0c) is acknowl- edged. the bkpt input has the same timing relationship to the data strobe trailing edge as read cycle data. there is no breakpoint acknowledge bus cycle when bdm is entered. 5.6.2.2.2 bgnd instruction. an illegal instruction, $4afa, is reserved for use by develop- ment tools. the cpu32+ defines $4afa (bgnd) to be a bdm entry point when bdm is enabled. if bdm is disabled, an illegal instruction trap is acknowledged. illegal instruction traps are discussed in 5.5.2.8 illegal or unimplemented instructions. 5.6.2.2.3 double bus fault. the cpu32+ normally treats a double bus fault (two bus faults in succession) as a catastrophic system error and halts. when this condition occurs during initial system debug (a fault in the reset logic), further debugging is impossible until the prob- lem is corrected. in bdm, the fault can be temporarily bypassed so that its origin can be iso- lated and eliminated. 5.6.2.3 entering bdm. when the processor detects a bkpt or a double bus fault or decodes a bgnd instruction, it suspends instruction execution and asserts the freeze output. freeze assertion is the first indication that the processor has entered bdm. once freeze has been asserted, the cpu enables the serial communication hardware and awaits a command. the cpu writes a unique value indicating the source of bdm transition into temporary reg- ister a (atemp) as part of the process of entering bdm. a user can poll atemp and deter- mine the source (see table 5-20) by issuing a read system register command (rsreg). atemp is used in most debugger commands for temporary storage?t is imperative that the rsreg command be the first command issued after transition into bdm. *ssw is described in detail in 5.5.3 fault recovery . a double bus fault during initial sp/pc fetch sequence is distinguished by a value of $ffffffff in the current instruction pc. at no other time will the processor write an odd value into this register. 5.6.2.4 command execution. figure 5-21 summarizes bdm command execution. commands consist of one 16-bit operation word and can include one or more 16-bit exten- sion words. each incoming word is read as it is assembled by the serial interface. the micro- code routine corresponding to a command is executed as soon as the command is complete. result operands are loaded into the output shift register to be shifted out as the next command is read. this process is repeated for each command until the cpu returns to normal operating mode. table 5-20. polling the bdm entry source source atemp 31?6 atemp 15? double bus fault ssw* $ffff bgnd instruction $0000 $0001 hardware breakpoint $0000 $0000
cpu32+ motorola mc68360 user? manual 5-63 5.6.2.5 bdm registers. bdm processing uses three special-purpose registers to track program context during development. a description of each register follows. 5.6.2.5.1 fault address register (far). the far contains the address of the faulting bus cycle immediately following a bus or address error. this address remains available until overwritten by a subsequent bus cycle. following a double bus fault, the far contains the address of the last bus cycle. the address of the first fault (if one occurred) is not visible to the user. 5.6.2.5.2 return program counter (rpc). the rpc points to the location where fetching will commence after transition from bdm to normal mode. this register should be accessed to change the flow of a program under development. changing the rpc to an odd value will cause an address error when normal mode prefetching begins. 5.6.2.5.3 current instruction program counter (pcc). the pcc holds a pointer to the first word of the last instruction executed prior to transition into bdm. due to instruction pipe- lining, the instruction pointed to may not be the instruction that caused the transition. an example is a breakpoint on a released write. the bus cycle may overlap as many as two subsequent instructions before stalling the instruction sequencer. a bkpt asserted during this cycle will not be acknowledged until the end of the instruction executing at completion of the bus cycle. pcc will contain $00000001 if bdm is entered via a double bus fault imme- diately out of reset. 5.6.2.6 returning from bdm. bdm is terminated when a resume execution (go) or call user code (call) command is received. both go and call flush the instruction pipe- line and prefetch instructions from the location pointed to by the rpc. the return pc and the memory space referred to by the sr supv bit reflect any changes made during bdm. freeze is negated prior to initiating the first prefetch. upon negation of freeze, the serial subsystem is disabled, and the signals revert to ipipe and ifetch functionality. 5.6.2.7 serial interface. communication with the cpu32+ during bdm occurs via a dedicated serial interface, which shares pins with other development features. the bkpt signal becomes the dsclk; dsi is received on ifetch , and dso is transmitted on ipipe . the serial interface uses a full-duplex synchronous protocol similar to the serial peripheral interface (spi) protocol. the development system serves as the master of the serial link since it is responsible for the generation of dsclk. if dsclk is derived from the cpu32+ system clock, development system serial logic is unhindered by the operating frequency of the target processor. operable frequency range of the serial clock is from dc to one-half the processor system clock frequency the serial interface operates in full-duplex mode?.e., data is transmitted and received simultaneously by both master and slave devices. in general, data transitions occur on the falling edge of dsclk and are stable by the following rising edge of dsclk. data is trans- mitted msb first and is latched on the rising edge of dsclk.
cpu32+ 5-64 mc68360 user? manual motorola . figure 5-21. bdm command execution flowchart the serial data word is 17 bits wide?6 data bits and a status/control (s/c) bit. bit 16 indicates the status of cpu-generated messages as listed in table 5-21 command and data transfers initiated by the development system should clear bit 16. the current implementation ignores this bit; however, motorola reserves the right to use this bit for future enhancements. 16 15 0 s/c data field table 5-21. cpu generated message encoding encoding data message type 0 xxxx valid data transfer 0 ffff command complete; status ok 1 0000 not ready with response; come again 1 0001 berr terminated bus cycle; data invalid 1 ffff illegal command yes no continue enter (bdm) ?assert freeze signal ?wait for command send initial command ?load command register ?enable shift clock ?shift out 17 bits ?disable shift clock execute command ?load: not ready/ response ?perform command ?store results read results/new command ?load command register ?enable shift clock ?shift in/out 17 bits ?disable shift clock ?read result register if results = "not ready" cpu32 activity development system activity
cpu32+ motorola mc68360 user? manual 5-65 5.6.2.7.1 cpu serial logic. cpu32+ serial logic, shown in the left-hand portion of figure 5-22, consists of transmit and receive shift registers and of control logic that includes syn- chronization, serial clock generation circuitry, and a received bit counter. both dsclk and dsi are synchronized to on-chip clocks, thereby minimizing the chance of propagating metastable states into the serial state machine. data is sampled during the high phase of clkout. at the falling edge of clkout, the sampled value is made available to internal logic. if there is no synchronization between cpu32+ and development system hardware, the minimum hold time on dsi with respect to dsclk is one full period of clk- out. figure 5-22. debug serial i/o block diagram the serial state machine begins a sequence of events based on the rising edge of the syn- chronized dsclk (see figure 5-23). synchronized serial data is transferred to the input shift register, and the received bit counter is decremented. one-half clock period later, the output shift register is updated, bringing the next output bit to the dso signal. dso changes rela- tive to the rising edge of dsclk and does not necessarily remain stable until the falling edge of dsclk. one clock period after the synchronized dsclk has been seen internally, the updated counter value is checked. if the counter has reached zero, the receive data latch is updated from the input shift register. at this same time, the output shift register is reloaded with the control logic serial in parallel out parallel in serial out execution unit status synchronize microsequencer parallel in serial out serial in parallel out result latch control logic status data dsi dso dsclk serial clock 16 16 rcv data latch cpu instruction register bus 16 command latch data 16 development system 0
cpu32+ 5-66 mc68360 user? manual motorola ?ot ready/come again?response. once the receive data latch has been loaded, the cpu is released to act on the new data. response data overwrites the ?ot ready?response when the cpu has completed the current operation. data written into the output shift register appears immediately on the dso signal. in general, this action changes the state of the signal from a high (?ot ready?response status bit) to a low (valid data status bit) logic level. however, this level change only occurs if the command completes successfully. error conditions overwrite the ?ot ready?response with the appro- priate response that also has the status bit set. figure 5-23. serial interfacetiming diagram a user can use the state change on dso to signal hardware that the next serial transfer may begin. a timeout of sufficient length to trap error conditions that do not change the state of dso should also be incorporated into the design. hardware interlocks in the cpu prevent result data from corrupting serial transfers in progress. 5.6.2.7.2 development system serial logic. the development system, as the master of the serial data link, must supply the serial clock. however, normal and bdm operations could interact if the clock generator is not properly designed. breakpoint requests are made by asserting bkpt to the low state in either of two ways. the primary method is to assert bkpt during a single bus cycle for which an exception is desired. another method is to assert bkpt , then continue to assert it until the cpu32+ responds by asserting freeze. this method is useful for forcing a transition into bdm when clkout freeze dsclk dsi sample window internal synchronized dsclk internal synchronized dsi clkout dso
cpu32+ motorola mc68360 user? manual 5-67 the bus is not being monitored. each method requires a slightly different serial logic design to avoid spurious serial clocks. figure 5-24 represents the timing required for asserting bkpt during a single bus cycle. figure 5-24. bkpt timing for single bus cycle figure 5-25 depicts the timing of the bkpt /freeze method. in both cases, the serial clock is left high after the final shift of each transfer. this technique eliminates the possibility of accidentally tagging the prefetch initiated at the conclusion of a bdm session. as mentioned previously, all timing within the cpu is derived from the rising edge of the clock; the falling edge is effectively ignored. figure 5-25. bkpt timing for forcing bdm figure 5-26 represents a sample circuit providing for both bkpt assertion methods. as the name implies, force_bgnd is used to force a transition into bdm by the assertion of bkpt . force_bgnd can be a short pulse or can remain asserted until freeze is asserted. once asserted, the set-reset latch holds bkpt low until the first shift_clk is applied. figure 5-26. bkpt /dsclk logic diagram shift_clk f orce_bgnd bkpt_tag freeze bkpt bkpt_tag freeze shift_clk f orce_bgnd bkpt bkpt/dsclk s1 s2 r q q reset force_bgnd bkpt_tag shift_clk
cpu32+ 5-68 mc68360 user? manual motorola bkpt_tag should be timed to the bus cycles since it is not latched. if extended past the assertion of freeze, the negation of bkpt_tag appears to the cpu32+ as the first dsclk. dsclk, the gated serial clock, is normally high, but it pulses low for each bit to be trans- ferred. at the end of the seventeenth clock period, it remains high until the start of the next transmission. clock frequency is implementation dependent and may range from dc to the maximum specified frequency. although performance considerations might dictate a hard- ware implementation, software solutions can be used provided serial bus timing is main- tained. 5.6.2.8 command set. the following paragraphs describe the command set available in bdm. 5.6.2.8.1 command format. the following standard bit .command format is utilized by all bdm commands. bits 15?0?peration field the operation field specifies the commands. this 6-bit field provides for a maximum of 64 unique commands. r/w field the r/w field specifies the direction of operand transfer. when the bit is set, the transfer is from thecpu to the development system. when the bit is cleared, data is written to the cpu or to memory from the development system. operand size for sized operations, this field specifies the operand data size. all addresses are ex- pressed as 32-bit absolute values. the size field is encoded as listed in table 5-22.. address/data (a/d) field the a/d field is used by commands that operate on address and data registers. it deter- mines whether the register field specifies a data or address register. one indicates an ad- dress register; zero indicates a data register. for other commands, this field may be interpreted differently. 15 1098765432 0 operation 0 r/w op size 0 0 a/d register extension word(s) table 5-22. size field encoding encoding operand size 00 byte 01 word 10 long 11 reserved
cpu32+ motorola mc68360 user? manual 5-69 register field: in most commands, this field specifies the register number for operations performed on an address or data register. extension word(s) (as required): at this time, no command requires an extension word to specify fully the operation to be performed, but some commands require extension words for addresses or immediate da- ta. addresses require two extension words because only absolute long addressing is per- mitted. immediate data can be either one or two words in length?yte and word data each require a single extension word; long-word data requires two words. both operands and addresses are transferred most significant word first. 5.6.2.8.2 command sequence diagram. a command sequence diagram (see figure 5- 27) illustrates the serial bus traffic for each command. each bubble in the diagram repre- sents a single 17-bit transfer across the bus. the top half in each diagram corresponds to the data transmitted by the development system to the cpu; the bottom half corresponds to the data returned by the cpu in response to the development system commands. com- mand and result transactions are overlapped to minimize latency. the cycle in which the command is issued contains the development system command mnemonic (in this example, "read memory location"). during the same cycle, the cpu responds with either the lowest order results of the previous command or with a command complete status (if no results were required). during the second cycle, the development system supplies the high-order 16 bits of the memory address. the cpu returns a "not ready" response unless the received command was decoded as unimplemented, in which case the response data is the illegal command encoding. if an illegal command response occurs, the development system should retrans- mit the command. note the ?ot ready?response can be ignored unless a memory bus cycle is in progress. otherwise, the cpu can accept a new serial transfer with eight system clock periods. in the third cycle, the development system supplies the low-order 16 bits of a memory address. the cpu always returns the ?ot ready?response in this cycle. at the completion of the third cycle, the cpu initiates a memory read operation. any serial transfers that begin while the memory access is in progress return the ?ot ready?response. results are returned in the two serial transfer cycles following the completion of memory access. the data transmitted to the cpu during the final transfer is the opcode for the fol- lowing command. should a memory access generate either a bus or address error, an error status is returned in place of the result data. 5.6.2.8.3 command set summary. the bdm command set is summarized in table 5-23. subsequent paragraphs contain detailed descriptions of each command.
cpu32+ 5-70 mc68360 user? manual motorola figure 5-27. command sequence diagram table 5-23. bdm command summary command mnemonic description read a/d register rareg/rdreg read the selected address or data register and return the results via the se- rial interface. write a/d register wareg/wdreg the data operand is written to the specified address or data register. read system register the specified system control register is read. all registers that can be read in supervisor mode can be read in bdm. write system register wsreg the operand data is written into the specified system control register. read memory location read read the sized data at the memory location specified by the long-word ad- dress. the sfc register determines the address space accessed. write memory location write write the operand data to the memory location specified by the long-word address. the dfc register determines the address space accessed. dump memory block dump used in conjunction with the read command to dump large blocks of mem- ory. an initial read is executed to set up the starting address of the block and to retrieve the first result. subsequent operands are retrieved with the dump command. fill memory block fill used in conjunction with the write command to fill large blocks of memory. an initial write is executed to set up the starting address of the block and to supply the first operand. subsequent operands are written with the fill command. resume execution go the pipeline is flushed and refilled before resuming instruction execution at the return pc. call user code call current pc is stacked at the location of the current sp. instruction execution begins at user patch code. reset peripherals rst asserts reset for 512 clock cycles. the cpu is not reset by this command. synonymous with the cpu reset instruction. no operation nop nop performs no operation and may be used as a null command. commands transmitted to the cpu32 command code transmitted during this cycle high-order 16 bits of memory address low-order 16 bits of memory address sequence taken if operation has not completed data unused from this transfer sequence taken if illegal command is received by cpu32 results from previous command responses from the cpu nonserial-related activity ms addr "not ready" xxx "illegal" ls addr "not ready" next cmd "not ready" read (long) ??? next cmd "not ready" xxx "not ready" xxx xxx berr/aerr xxx ms result next cmd ls result read memory location next command code sequence taken if bus error or address error occurs on memory access high- and low-order 16 bits of result
cpu32+ motorola mc68360 user? manual 5-71 5.6.2.8.4 read a/d register (rareg/rdreg). read the selected address or data regis- ter and return the results via the serial interface. command format: command sequence: operand data: none result data: the contents of the selected register are returned as a long-word value. the data is re- turned most significant word first. 5.6.2.8.5 write a/d register (wareg/wdreg). the operand (long-word) data is written to the specified address or data register. all 32 bits of the register are altered by the write. command format: command sequence: operand data: long-word data is written into the specified address or data register. the data is supplied most significant word first. result data: command complete status ($0ffff) is returned when register write is complete. 5.6.2.8.6 read system register (rsreg). the specified system control register is read. all registers that can be read in supervisor mode can be read in bdm. several internal tem- porary registers are also accessible. 1514131211109876543210 001000011000a/d register 15141312111098765432 0 001000001000a/d register rdreg/rareg ??? xxx ms result xxx "illegal" next cmd ls result next cmd "not ready" wdreg/wareg ??? ms data xxx "illegal" ls data "not ready" next cmd "not ready" "cmd complete" next cmd "not ready"
cpu32+ 5-72 mc68360 user? manual motorola command format: command sequence: operand data: none result data: always returns 32 bits of data, regardless of the size of the register being read. if the reg- ister is less than 32 bits, the result is returned zero extended. register field: the system control register is specified by the register field (see table 5-24). 5.6.2.8.7 write system register (wsreg). operand data is written into the specified sys- tem control register. all registers that can be written in supervisor mode can be written in bdm. several internal temporary registers are also accessible. command format: 1514131211109876543 0 001001001000 register table 5-24. register field for rsreg and wsreg system register select code return program counter (rpc) 0000 current instruction program counter (pcc) 0001 status register (sr) 1011 user stack pointer (usp) 1100 supervisor stack pointer (ssp) 1101 source function code register (sfc) 1110 destination function code register (dfc) 1111 temporary register a (atemp) 1000 fault address register (far) 1001 vector base register (vbr) 1010 1514131211109876543 0 001001001000 register rsreg ??? xxx ms result xxx "illegal" next cmd ls result next cmd "not ready"
cpu32+ motorola mc68360 user? manual 5-73 command sequence: operand data: the data to be written into the register is always supplied as a 32-bit long word. if the reg- ister is less than 32 bits, the least significant word is used. result data: ?ommand complete?status is returned when register write is complete. register field: the system control register is specified by the register field (see table 5-24). the far is a read-only register?ny write to it is ignored. 5.6.2.8.8 read memory location (read). read the sized data at the memory location specified by the long-word address. only absolute addressing is supported. the sfc regis- ter determines the address space accessed. valid data sizes include byte, word, or long word. command format: command sequence: operand data: the single operand is the long-word address of the requested memory location. 1514131211109876543210 00011001 op size 000000 ms data xxx "illegal" ls data "not ready" next cmd "not ready" "cmd complete" next cmd wsreg ??? "not ready" ms addr "not ready" xxx "illegal" ls addr "not ready" next cmd "not ready" read (b/w) ??? next cmd "not ready" xxx "not ready" next cmd result xxx berr/aerr read memory location ms addr "not ready" xxx "illegal" ls addr "not ready" next cmd "not ready" read (long) ??? next cmd xxx "not ready" ms result xxx berr/aerr read memory location xxx next cmd ls result "not ready"
cpu32+ 5-74 mc68360 user? manual motorola result data: the requested data is returned as either a word or long word. byte data is returned in the least significant byte of a word result, with the upper byte cleared. word results return 16 bits of significant data; long-word results return 32 bits. a successful read operation returns data bit 16 cleared. if a bus or address error is en- countered, the returned data is $10001. 5.6.2.8.9 write memory location (write). write the operand data to the memory loca- tion specified by the long-word address. the dfc register determines the address space accessed. only absolute addressing is supported. valid data sizes include byte, word, and long word. command format: command sequence: operand data: two operands are required for this instruction. the first operand is a long-word absolute address that specifies a location to which the operand data is to be written. the second operand is the data. byte data is transmitted as a 16-bit word, justified in the least signif- icant byte; 16- and 32-bit operands are transmitted as 16 and 32 bits, respectively. 1514131211109876543210 00011000 op size 000000 ms addr "not ready" xxx "illegal" ls addr "not ready" next cmd "not ready" write (b/w) ??? next cmd "not ready" xxx "not ready" xxx xxx berr/aerr next cmd "cmd complete" data "not ready" write memory location ms addr "not ready" xxx "illegal" ls addr "not ready" next cmd "not ready" write (long) ??? ms data "not ready" ls data "not ready" write memory location next cmd "not ready" xxx "not ready" xxx xxx berr/aerr next cmd "cmd complete"
cpu32+ motorola mc68360 user? manual 5-75 result data: successful write operations return a status of $0ffff. bus or address errors on the write cycle are indicated by the assertion of bit 16 in the status message and by a data pattern of $0001. 5.6.2.8.10 dump memory block (dump). dump is used in conjunction with the read command to dump large blocks of memory. an initial read is executed to set up the starting address of the block and to retrieve the first result. subsequent operands are retrieved with the dump command. the initial address is incremented by the operand size (1, 2, or 4) and saved in a temporary register. subsequent dump commands use this address, increment it by the current operand size, and store the updated address back in the temporary register. note the dump command does not check for a valid address in the temporary register?ump is a valid command only when pre- ceded by another dump or by a read command. otherwise, the results are undefined. the nop command can be used for intercommand padding without corrupting the address pointer. the size field is examined each time a dump command is given, allowing the operand size to be altered dynamically. command format: command sequence: 1514131211109876543210 00011101 op size 000000 dump (long) ??? xxx "not ready" next cmd result xxx berr/aerr xxx "illegal" next cmd "not ready" next cmd "not ready" read memory location xxx "not ready" next cmd ms result xxx berr/aerr xxx "illegal" next cmd "not ready" next cmd "not ready" read memory location next cmr ls result dump (long) ???
cpu32+ 5-76 mc68360 user? manual motorola operand data: none result data: requested data is returned as either a word or long word. byte data is returned in the least significant byte of a word result. word results return 16 bits of significant data; long-word results return 32 bits. status of the read operation is returned as in the read command: $0xxxx for success, $10001 for bus or address errors. 5.6.2.8.11 fill memory block (fill). fill is used in conjunction with the write com- mand to fill large blocks of memory. an initial write is executed to set up the starting address of the block and to supply the first operand. subsequent operands are written with the fill command. the initial address is incremented by the operand size (1, 2, or 4) and is saved in a temporary register. subsequent fill commands use this address, increment it by the current operand size, and store the updated address back in the temporary register. note the fill command does not check for a valid address in the temporary register?ill is a valid command only when preced- ed by another fill or by a write command. otherwise, the re- sults are undefined. the nop command can be used for intercommand padding without corrupting the address pointer. the size field is examined each time a fill command is given, allowing the operand size to be altered dynamically. command format: command sequence: 1514131211109876543210 00011100 op size 000000 next cmd "not ready" "not ready" xxx berr/aerr "cmd complete" data "not ready" xxx next cmd xxx "illegal" next cmd "not ready" fill (long) ??? write memory location next cmd "not ready" xxx "not ready" xxx berr/aerr "cmd complete" ms data "not ready" next cmd xxx "illegal" next cmd "not ready" ls data "not ready" write memory location fill (b/w) ???
cpu32+ motorola mc68360 user? manual 5-77 operand data: a single operand is data to be written to the memory location. byte data is transmitted as a 16-bit word, justified in the least significant byte; 16- and 32-bit operands are transmitted as 16 and 32 bits, respectively. result data: status is returned as in the write command: $0ffff for a successful operation and $10001 for a bus or address error during write. 5.6.2.8.12 resume execution (go). the pipeline is flushed and refilled before normal instruction execution is resumed. prefetching begins at the return pc and current privilege level. if either the pc or sr is altered during bdm, the updated value of these registers is used when prefetching commences. note the processor exits bdm when a bus error or address error oc- curs on the first instruction prefetch from the new pc?he error is trapped as a normal mode exception. the stacked value of the current pc may not be valid in this case, depending on the state of the machine prior to entering bdm. for address error, the pc does not reflect the true return pc. instead, the stacked fault ad- dress is the (odd) return pc. command format: command sequence: operand data: none result data: none 5.6.2.8.13 call user code (call). this instruction provides a convenient way to patch user code. the return pc is stacked at the location pointed to by the current sp. the stacked pc serves as a return address to be restored by the rts command that terminates the patch routine. after stacking is complete, the 32-bit operand data is loaded into the pc. the pipeline is flushed and refilled from the location pointed to by the new pc, bdm is exited, and normal mode instruction execution begins. 1514131211109876543210 0000110000000000 go ??? normal mode xxx "illegal" next cmd "not ready"
cpu32+ 5-78 mc68360 user? manual motorola note if a bus error or address error occurs during return address stacking, the cpu returns an error status via the serial interface and remains in bdm. if a bus error or address error occurs on the first instruction prefetch from the new pc, the processor exits bdm and the er- ror is trapped as a normal mode exception. the stacked value of the current pc may not be valid in this case, depending on the state of the machine prior to entering bdm. for address error, the pc does not reflect the true return pc. instead, the stacked fault address is the (odd) return pc. command format: command sequence: operand data: the 32-bit operand data is the starting location of the patch routine, which is the initial pc upon exiting bdm. result data: none as an example, consider the following code segment. it outputs a character from the mc68340 serial module channel a. chkstat: move.b sra,d0move serial status to d0 bne.b chkstatloop until condition true move.b tba,outputtransmit character missing: andi.b #3,d0check for txemp flag rts bdm and the call command can be used to patch the code as follows: 1. breakpoint user program at chkstat 2. enter bdm 1514131211109876543210 0000100000000000 ls addr "not ready" stack return pc ms addr "not ready" xxx "illegal" next cmd "not ready" call ??? normal mode xxx berr/aerr next cmd "not ready" freeze negated prefetch started
cpu32+ motorola mc68360 user? manual 5-79 3. execute call command to missing 4. exit bdm 5. execute missing code 6. return to user program 5.6.2.8.14 reset peripherals (rst). rst asserts reset for 512 clock cycles. the cpu is not reset by this command. this command is synonymous with the cpu reset instruction. command format: command sequence: operand data: none result data: the ?ommand complete?response ($0ffff) is loaded into the serial shifter after nega- tion of reset. 5.6.2.8.15 no operation (nop). nop performs no operation and may be used as a null command where required. command format: command sequence: operand data: none 1514131211109876543210 0000010000000000 1514131211109876543210 0000000000000000 reset ??? assert reset xxx "not ready" xxx "illegal" next cmd "not ready" next cmd "cmd complete" xxx "illegal" "not ready" nop ??? next cmd "cmd complete" next cmd
cpu32+ 5-80 mc68360 user? manual motorola result data: the ?ommand complete?response ($0ffff) is returned during the next shift operation. 5.6.2.8.16 future commands. unassigned command opcodes are reserved by motorola for future expansion. all unused formats within any revision level will perform a nop and return the illegal command response. 5.6.3 deterministic opcode tracking the cpu32+ utilizes deterministic opcode tracking to trace program execution. two signals, ipipe and ifetch , provide all information required to analyze instruction pipeline opera- tion. 5.6.3.1 instruction fetch (ifetch ). ifetch indicates which bus cycles are access- ing data to fill the instruction pipeline. ifetch is pulse-width modulated to multiplex two indi- cations on a single pin. asserted for a single clock cycle, ifetch indicates that the data from the current bus cycle is to be routed to the instruction pipeline. ifetch held low for two clock cycles indicates that the instruction pipeline has been flushed. the data from the bus cycle is used to begin filling the empty pipeline. both user and supervisor mode fetches are signaled by ifetch . proper tracking of bus cycles via ifetch on a fast bus requires a simple state machine. on a two-clock bus, ifetch may signal a pipeline flush with associated prefetch followed immediately by a second prefetch. that is, ifetch remains asserted for three clocks, two clocks indicating the flush/fetch and a third clock signaling the second fetch. these two oper- ations are easily discerned if the tracking logic samples ifetch on the two rising edges of clko1, which follow the as (ds during show cycles) falling edge. three-clock and slower bus cycles allow time for negation of the signal between consecutive indications and do not experience this operation. 5.6.3.2 instruction pipe (ipipe1 ?pipe0 ). the internal instruction pipeline can be modeled as a three-stage fifo (see figure 5-28). stage a is an input buffer?ata can be used out of stages b and c. the ipipe1 ?pipe0 signals indicate the advance of instructions in the pipeline. the 16-bit instruction register a (ira) and 16-bit instruction register l (irl) hold incoming words as they are prefetched. no decoding occurs in ira or irl. instruction register b (irb) provides initial decoding of the opcode and decoding of extension words; it is a source of immediate data. instruction register c (irc) supplies residual opcode decoding during instruction execution. ira is of higher priority than irl. irl is only loaded from the imb when a 32-bit instruction fetch is performed. ira is loaded during every instruction fetch. irb is loaded from the contents of ira or irl, depending on which one is currently valid. if both ira and irl are valid, then ira is loaded into irb before irl is loaded into irb.
cpu32+ motorola mc68360 user? manual 5-81 figure 5-28. functional model of instruction pipeline when ipipe1 is low during a clock cycle, it indicates the use of data from irb on that clock cycle. ipipe1 should be sampled by the user on the falling edge of clko1. regardless of the presence of valid data in ira or irl, the contents of irb are invalidated when ipipe1 is asserted. if ira or irl contain valid data, the data is copied into irb (ira/irl irb), and the irb stage is revalidated. when ipipe0 is low during a clock cycle, it indicates the start of a new instruction and sub- sequent replacement of data in irc. this action causes a full advance of the pipeline (irb irc and ira/irl irb). ira and/or irl is refilled during the next instruction fetch bus cycle. data loaded into ira and irl propagates automatically through subsequent empty pipeline stages. signals that show the progress of instructions through irb and irc are necessary to accurately monitor pipeline operation. these signals are provided by ira, irl and irb validity bits. when a pipeline advance occurs, the validity bit of the stage being loaded is set, and the validity bit of the stage supplying the data is negated. because instruction execution is not timed to bus activity, ipipe1 ?pipe0 are synchronized with the system clock and not the bus. figure 5-29 illustrates the timing in relation to the sys- tem clock. figure 5-29. instruction pipeline timing diagram i r c data bus (31?6) extension words opcodes residual i r b i r a data bus (15?) i r l ipipe0 instruction start extension long word used instruction start irb irc clko1 ipipe1 ira/irl irb ira/irl irb ira/irl irb irb irc ira/irl irb
cpu32+ 5-82 mc68360 user? manual motorola ipipe1 ?pipe0 should be sampled on the falling edge of the clock. loading irc always indi- cates that an instruction is beginning execution ?the opcode is loaded into irc by the transfer. in bdm mode, the data output dso is connected to ipipe0 . the ipipe1 pin is unused in bdm mode. 5.6.3.3 opcode tracking during loop mode. ipipe and ifetch continue to work normally during loop mode. ifetch indicates all instruction fetches up through the point that data begins recirculating within the instruction pipeline. ipipe continues to signal the start of instructions and the use of extension words even though data is being recirculated inter- nally. ifetch returns to normal operation with the first fetch after exiting loop mode. 5.7 instruction execution timing this section describes the instruction execution timing of the cpu32+. external clock cycles are used to provide accurate execution and operation timing guidelines, but not exact timing for every possible circumstance. this approach is used because exact execution time for an instruction or operation depends on concurrence of independently scheduled resources, on memory speeds, and on other variables. an assembly language programmer or compiler writer can use the information in this section to predict the performance of the cpu32+. additionally, timing for exception processing is included so that designers of multitasking or real-time systems can predict task-switch over- head, maximum interrupt latency, and similar timing parameters. instruction timing is given in clock cycles to eliminate clock frequency dependency. most instruction timing information in the following subsections is taken from the cpu32 documentation. it applies to the cpu32+ when it is executing in 16-bit mode. however, a summary of experiments run on the cpu32+ and the cpu32 is given in table 5-25. the tests show general indications of performance improvement of the cpu32+ over the cpu32. actual results on real applications may vary. note: pi = % performance increase over a cpu32 in the same conditions bu = % bus utilization taken by the processor in the experiment note that the cpu32+ gains a significant performance advantage (58%) over the original cpu32 when using long operands on a slow external bus. (most compilers generate code using long operands where possible.) thus, the cpu32+ performance in 32-bit mode "falls off" less rapidly than does the original cpu32. table 5-25. cpu32+ performance improvement over the cpu32 bus cycle length conditions 2 3 5 pi/bu (see note) 16-bit data bus 0/78 0/89 0/95 32-bit data bus with 16-bit operands only (e.g., move.w, clr.w, etc.) 6/52 13/65 24/76 32-bit data bus with 32-bit operands only (e.g., move.l, movea.l, movem.l etc.) 13/50 40/62 58/73
cpu32+ motorola mc68360 user? manual 5-83 also, note that the use of a 32-bit data bus reduces external bus utilization by 19 to 28 per- centage points (e.g., 78?0 = 28%). this reduction gives more time for peripherals, such as dma channels, to use the bus without adversely affecting overall system performance. in the best case, the cpu32+ can use as little as 50% of the bus, even though instructions exe- cute continuously. 5.7.1 resource scheduling the cpu32+ contains several independently scheduled resources. the organization of these resources within the cpu32+ is shown in figure 5-30. some variation in instruction execution timing results from concurrent resource utilization. because resource scheduling is not directly related to instruction boundaries, it is impossible to make an accurate predic- tion of the time required to complete an instruction without knowing the entire context within which the instruction is executing. 5.7.1.1 microsequencer. the microsequencer either executes microinstructions or awaits completion of accesses necessary to continue microcode execution. the microse- quencer supervises the bus controller, instruction execution, and internal processor opera- tions such as calculation of ea and setting of condition codes. it also initiates instruction word prefetches after a change of flow and controls validation of instruction words in the instruction pipeline. 5.7.1.2 instruction pipeline. the cpu32+ contains a two-word instruction pipeline where instruction opcodes are decoded. each stage of the pipeline is initially filled under microsequencer control and subsequently refilled by the prefetch controller as it empties. stage a of the instruction pipeline is a buffer. prefetches completed on the bus before stage b empties are temporarily stored in this buffer. instruction words (instruction operation words and all extension words) are decoded at stage b. residual decoding and execution occur in stage c. each pipeline stage has an associated status bit that shows whether the word in that stage was loaded with data from a bus cycle that terminated abnormally. 5.7.1.3 bus controller resources. the bus controller consists of the instruction prefetch controller, the write pending buffer, and the microbus controller. these three resources transact all reads, writes, and instruction prefetches required for instruction exe- cution. the bus controller and microsequencer operate concurrently. the bus controller can per- form a read or write or schedule a prefetch while the microsequencer controls ea calculation or sets condition codes. the microsequencer can also request a bus cycle that the bus controller cannot perform immediately. when this happens, the bus cycle is queued, and the bus controller runs the cycle when the current cycle has completed.
cpu32+ 5-84 mc68360 user? manual motorola figure 5-30. block diagram of independent resources 5.7.1.3.1 prefetch controller. the instruction prefetch controller receives an initial request from the microsequencer to initiate prefetching at a given address. subsequent prefetches are initiated by the prefetch controller whenever a pipeline stage is invalidated, either through instruction completion or through use of extension words. prefetch occurs as soon as the bus is free of operand accesses previously requested by the microsequencer. addi- tional state information permits the controller to inhibit prefetch requests when a change in instruction flow (e.g., a jump or branch instruction) is anticipated. in a typical program, 10 to 25 percent of the instructions cause a change of flow. each time a change occurs, the instruction pipeline must be flushed and refilled from the new instruc- tion stream. if instruction prefetches, rather than operand accesses, were given priority, many instruction words would be flushed unused, and necessary operand cycles would be delayed. to maximize available bus bandwidth, the cpu32+ will schedule a prefetch only when the next instruction is not a change-of-flow instruction and when there is room in the pipeline for the prefetch. 5.7.1.3.2 write-pending buffer. the cpu32+ incorporates a single-operand write-pending buffer. the buffer permits the microsequencer to continue execution after a request for a write cycle is queued in the bus controller. the time needed for a write at the end of an instruction can overlap the head cycle time for the following instruction, thus reducing overall execution time. interlocks prevent the microsequencer from overwriting the buffer. microsequencer and control control store control logic instruction pipeline stage stage c b execution unit program counter section data s ection write-pending buffer prefetch c ontrolle r microbus c ontrolle r address bu s data b us bus control signals
cpu32+ motorola mc68360 user? manual 5-85 5.7.1.3.3 microbus controller. the microbus controller performs bus cycles issued by the microsequencer. operand accesses always have priority over instruction prefetches. word and byte operands are accessed in a single cpu-initiated bus cycle, although the external bus interface may be required to initiate a second cycle when a word operand is sent to a byte-sized external port. if long operands are accessed from a 16-bit port, they are accessed in two bus cycles, most significant word first. the instruction pipeline is capable of recognizing instructions that cause a change of flow. it informs the bus controller when a change of flow is imminent, and the bus controller refrains from starting prefetches that would be discarded due to the change of flow. 5.7.1.4 instruction execution overlap. overlap is the time, measured in clock cycles, that an instruction executes concurrently with the previous instruction. as shown in figure 5-31, portions of instructions a and b execute simultaneously, reducing total execu- tion time. because portions of instructions b and c also overlap, overall execution time for all three instructions is also reduced. each instruction contributes to the total overlap time. the portion of execution time at the end of instruction a that can overlap the beginning of instruction b is called the tail of instruc- tion a. the portion of execution time at the beginning of instruction b that can overlap the end of instruction a is called the head of instruction b. the total overlap time between in- structions a and b is the smaller tail of a and the head of b. figure 5-31. simultaneous instruction execution the execution time attributed to instructions a, b, and c after considering the overlap is illus- trated in figure 5-32. the overlap time is attributed to the execution time of the completing instruction. the following equation shows the method for calculating the overlap time: overlap = min (tail n , head n+1 ) overlap overlap instruction a instruction b instruction c
cpu32+ 5-86 mc68360 user? manual motorola figure 5-32. attributed instruction times 5.7.1.5 effects of wait states. the cpu32+ access time for on-chip peripherals is two clocks. while two-clock external accesses are possible when the bus is operated in a synchronous mode, a typical external memory speed is three or more clocks. all instruction times listed in this section are for word access only (unless an explicit excep- tion is given), and are based on the assumption that both instruction fetches and operand cycles are to a two-clock memory. wait states due to slow external memory must be added to the access time for each bus cycle. a typical application has a mixture of bus speeds?rogram execution from an off-chip rom, accesses to on-chip peripherals, storage of variables in slow off-chip ram, and accesses to external peripherals with speeds ranging from moderate to very slow. to arrive at an accurate instruction time calculation, each bus access must be individually considered. many instructions have a head cycle count, which can overlap the cycles of an operand fetch to slower memory started by a previous instruction. in these cases, an increase in access time has no effect on the total execution time of the pair of instructions. to trace instruction execution time by monitoring the external bus, note that the order of operand accesses for a particular instruction sequence is always the same provided bus speed is unchanged and the interleaving of instruction prefetches with operands within each sequence is identical. 5.7.1.6 instruction execution time calculation. the overall execution time for an instruction depends on the amount of overlap with previous and subsequent instructions. to calculate an instruction time estimate, the entire code sequence must be analyzed. to derive the actual instruction execution times for an instruction sequence, the instruction times listed in the tables must be adjusted to account for overlap. the formula for this calculation is as follows: c 1 - min (t 1 , h 2 ) + c 2 - min (t 2 , h 3 ) + c 3 - min (t 3 , h 4 ) + . . . where: c n is the number of cycles listed for instruction n overlap period (absorbed by instruction a) overlap period (absorbed by instruction b) instruction a instruction b instruction c
cpu32+ motorola mc68360 user? manual 5-87 t n is the tail time for instruction n h n is the head time for instruction n min (t n , h m ) is the minimum of parameters t n and h m the number of cycles for the instruction (c n ) can include one or two ea calculations in addi- tion to the raw number in the cycles column. in these cases, calculate overall instruction time as if it were for multiple instructions, using the following equation: cea - min (t ea , h op ) + c op where: cea is the instruction? ea time c op is the instruction? operation time t ea is the ea? tail time h op is the instruction operation? head time min (t n , h m ) is the minimum of parameters t n and h m the overall head for the instruction is the head for the ea, and the overall tail for the instruc- tion is the tail for the operation. therefore, the actual equation for execution time becomes: c op1 - min (t op1 , h ea2 ) + cea 2 - min (t ea2 , h op2 ) + c op2 - min (t op2 , h ea3 ) + . . . every instruction must prefetch to replace itself in the instruction pipe. usually, these prefetches occur during or after an instruction. a prefetch is permitted to begin in the first clock of any indexed ea mode operation. additionally, a prefetch for an instruction is permitted to begin two clocks before the end of an instruction provided the bus is not being used. if the bus is being used, then the prefetch occurs at the next available time when the bus would otherwise be idle. 5.7.1.7 effects of negative tails. when the cpu32+ changes instruction flow, the instruction decode pipeline must begin refilling before instruction execution can resume. refilling forces a two-clock idle period at the end of the change-of-flow instruction. this idle period can be used to prefetch an additional word on the new instruction path. because of the stipulation that each instruction must prefetch to replace itself, the concept of negative tails has been introduced to account for these free clocks on the bus. on a two-clock bus, it is not necessary to adjust instruction timing to account for the potential extra prefetch. the cycle times of the microsequencer and bus are matched, and no addi- tional benefit or penalty is obtained. in the instruction execution time equations, a zero should be used instead of a negative number. negative tails are used to adjust for slower fetches on slower buses. normally, increasing the length of prefetch bus cycles directly affects the cycle count and tail values found in the tables.
cpu32+ 5-88 mc68360 user? manual motorola in the following equations, negative tail values are used to negate the effects of a slower bus. the equations are generalized, however, so that they may be used on any speed bus with any tail value. new_tail = old_tail + (new_clock ?2) if ((new_clock ?4) > 0) then new_cycle = old_cycle + (new_clock ?2) + (new_clock ?4) else new_cycle = old_cycle + (new _clock ?2) where: new_tail/new_cycle is the adjusted tail/cycle at the slower speed old_tail/old_cycle is the value listed in the instruction timing tables new_clock is the number of clocks per cycle at the slower speed note that many instructions listed as having negative tails are change-of-flow instructions and that the bus speed used in the calculation is that of the new instruction stream. 5.7.2 instruction timing tables the following assumptions apply to the times shown in the subsequent tables: 1. a 16-bit data bus is used for all memory accesses (cpu32+ in 16-bit mode). 2. memory access times are based on two-clock bus cycles with no wait states. 3. the instruction pipeline is full at the beginning of the instruction and is refilled by the end of the instruction. three values are listed for each instruction and addressing mode: head: the number of cycles available at the beginning of an instruction to complete a previous instruction write or to perform a prefetch. tail: the number of cycles an instruction uses to complete a write. cycles: four numbers per entry, three contained in parentheses. the outer number is the minimum number of cycles required for the instruction to complete. numbers within the parentheses represent the number of bus accesses performed by the instruction. the first number is the number of operand read accesses performed by the instruction. the second number is the number of instruction fetches per- formed by the instruction, including all prefetches that keep the instruction and the instruction pipeline filled. the third number is the number of write accesses per- formed by the instruction. as an example, consider an add.l (12, a3, d7.w * 4), d2 instruction. paragraph 5.7.2.5 arithmetic/logic instructions shows that the instruction has a head = 0, a tail = 0, and cycles = 2 (0/1/0). however, in indexed address register indirect addressing mode, additional time is required to fetch the ea. paragraph 5.7.2.1 fetch effective address gives addressing mode data. for (d 8 , an, xn.sz * scale), head = 4, tail = 2, cycles = 8 (2/1/ 0). because this example is for a long access and the fetch ea table lists data for word
cpu32+ motorola mc68360 user? manual 5-89 accesses, add two clocks to the tail and to the number of cycles (??in table notation) to obtain head = 4, tail = 4, cycles = 10 (2/1/0). assuming that no trailing write exists from the previous instruction, ea calculation requires six clocks. replacement fetch for the ea occurs during these six clocks, leaving a head of four. if there is no time in the head to perform a prefetch due to a previous trailing write, then additional time to perform the prefetches must be allotted in the middle of the instruction or after the tail. the total number of clocks for bus activity is as follows: (2 reads ? 2 clocks/read) + (1 instruction access ? 2 clocks/access) + (0 writes ? 2 clocks/write) = 6 clocks of bus activity the number of internal clocks (not overlapped by bus activity) is as follows: 10 clocks total - 6 clocks bus activity = 4 internal clocks memory read requires two bus cycles at two clocks each. this read time, implied in the tail figure for the ea, cannot be overlapped with the instruction because the instruction has a head of zero. an additional two clocks are required for the add instruction itself. the total is 6 + 4 + 2 = 12 clocks. if bus cycles take more time (i.e., the memory is off-chip), add an appropriate number of clocks to each memory access. the instruction sequence move.l d0, (a0) followed by lsl.l #7, d2 provides an example of overlapped execution. the move instruction has a head of zero and a tail of four because it is a long write. the lsl instruction has a head of four. the trailing write from the move overlaps the lsl head completely. thus, the two-instruction sequence has a head of zero, a tail of zero, and a total execution of 8 rather than 12 clocks. general observations regarding calculation of execution time are as follows: any time the number of bus cycles is listed as "x", substitute a value of one for byte and word cycles and a value of two for long cycles. for long bus cycles, usually add a value of two to the tail. the time calculated for an instruction on a three-clock (or longer) bus is usually longer than the actual execution time. all times shown are for two-clock bus cycles. if the previous instruction has a negative tail, then a prefetch for the current instruction can begin during the execution of that previous instruction. certain instructions requiring an immediate extension word (immediate word ea, abso- lute word ea, address register indirect with displacement ea, conditional branches with word offsets, bit operations, lpstop, tbl, movem, movec, moves, movep, total number of clocks number of read cycles number of instruction access cycles number of write cycles 8(2 /1/0)
cpu32+ 5-90 mc68360 user? manual motorola mul.l, div.l, chk2, cmp2, and dbcc) are not permitted to begin until the extension word has been in the instruction pipeline for at least one cycle. this does not apply to long offsets or displacements. 5.7.2.1 fetch effective address. the fetch ea table indicates the number of clock periods needed for the processor to calculate and fetch the specified ea. the total number of clock cycles is outside the parentheses. the numbers inside parentheses (r/p/w) are included in the total clock cycle number. all timing data assumes two-clock reads and writes. instruction head tail cycles notes dn 0(0/0/0) an 0(0/0/0) (an) 1 1 3(x/0/0) 1 (an) + 1 1 3(x/0/0) 1 - (an) 2 2 4(x/0/0) 1 (d 16 ,an) or (d 16 ,pc) 1 3 5(x/1/0) 1,3 (xxx).w 1 3 5(x/1/0) 1 (xxx).l 1 5 7(x/2/0) 1 # data .b 1 1 3(0/1/0) 1 # data .w 1 1 3(0/1/0) 1 # data .l 1 3 5(0/2/0) 1 (d 8 ,an,xn.sz ? sc) or (d 8 ,pc,xn.sz ? sc) 4 2 8(x/1/0) 1,2,3,4 (0) (all suppressed) 2 2 6(x/1/0) 1,4 (d 16 ) 1 3 7(x/2/0) 1,4 (d 32 ) 1 5 9(x/3/0) 1,4 (an) 1 1 5(x/1/0) 1,2,4 (xm.sz ? sc) 4 2 8(x/1/0) 1,2,4 (an,xm.sz ? sc) 4 2 8(x/1/0) 1,2,3,4 (d 16 ,an) or (d 16 ,pc) 1 3 7(x/2/0) 1,3,4 (d 32 ,an) or (d 32 ,pc) 1 5 9(x/3/0) 1,3,4 (d 16 ,an,xm) or (d 16 ,pc,xm) 2 2 8(x/2/0) 1,3,4 (d 32 ,an,xm) or (d 32 ,pc,xm) 1 3 9(x/3/0) 1,3,4 (d 16 ,an,xm.sz ? sc) or (d 16 ,pc,xm.sz ? sc) 2 2 8(x/2/0) 1,2,3,4 (d 32 ,an,xm.sz ? sc) or (d 32 ,pc,xm.sz ? sc) 1 3 9(x/3/0) 1,2,3,4 x = there is one bus cycle for byte and word operands and two bus cycles for long-word operands. for long-word bus cycles, add two clocks to the tail and to the number of cycles. notes: 1. the read of the ea and replacement fetches overlap the head of the operation by the amount specified in the tail. 2. size and scale of the index register do not affect execution time. 3. the pc may be substituted for the base address register an. 4. when adjusting the prefetch time for slower buses, extra clocks may be subtracted from the head until the head reaches zero, at which time additional clocks must be added to both the tail and cycle counts. 5. timing is calculated with the cpu32+ in 16-bit mode.
cpu32+ motorola mc68360 user? manual 5-91 5.7.2.2 calculate effective address. the calculate ea table indicates the num- ber of clock periods needed for the processor to calculate a specified ea. the timing is equivalent to fetch ea except there is no read cycle. the tail and cycle time are reduced by the amount of time the read would occupy. the total number of clock cycles is outside the parentheses. the numbers inside parentheses (r/p/w) are included in the total clock cycle number. all timing data assumes two-clock reads and writes. instruction head tail cycles notes dn 0(0/0/0) an 0(0/0/0) (an) 1 0 2(0/0/0) (an) + 1 0 2(0/0/0) - (an) 2 0 2(0/0/0) (d 16 ,an) or (d 16 ,pc) 1 1 3(0/1/0) 1,3 (xxx).w 1 1 3(0/1/0) 1 (xxx).l 1 3 5(0/2/0) 1 (d 8 ,an,xn.sz ? sc) or (d 8 ,pc,xn.sz ? sc) 4 0 6(0/1/0) 2,3,4 (0) (all suppressed) 2 0 4(0/1/0) 4 (d 16 ) 1 1 5(0/2/0) 1,4 (d 32 ) 1 3 7(0/3/0) 1,4 (an) 1 0 4(0/1/0) 4 (xm.sz ? sc) 4 0 6(0/1/0) 2,4 (an,xm.sz ? sc) 4 0 6(0/1/0) 2,4 (d 16 ,an) or (d 16 ,pc) 1 1 5(0/2/0) 1,3,4 (d 32 ,an) or (d 32 ,pc) 1 3 7(0/3/0) 1,3,4 (d 16 ,an,xm) or (d 16 ,pc,xm) 2 0 6(0/2/0) 3,4 (d 32 ,an,xm) or (d 32 ,pc,xm) 1 1 7(0/3/0) 1,3,4 (d 16 ,an,xm.sz ? sc) or (d 16 ,pc,xm.sz ? sc) 2 0 6(0/2/0) 2,3,4 (d 32 ,an,xm.sz ? sc) or (d 32 ,pc,xm.sz ? sc) 1 1 7(0/3/0) 1,2,3,4 notes: 1. replacement fetches overlap the head of the operation by the amount specified in the tail. 2. size and scale of the index register do not affect execution time. 3. the pc may be substituted for the base address register an. 4. when adjusting the prefetch time for slower buses, extra clocks may be subtracted from the head until the head reaches zero, at which time additional clocks must be added to both the tail and cycle counts. 5. timing is calculated with the cpu32+ in 16-bit mode
cpu32+ 5-92 mc68360 user? manual motorola 5.7.2.3 move instruction. the move instruction table indicates the number of clock periods needed for the processor to calculate the destination ea and to perform a move or movea instruction. for entries with cea or fea, refer to the appropriate table to calculate that portion of the instruction time. destination eas are divided by their formats (see cpu32 reference manual). the total number of clock cycles is outside the parentheses. the numbers inside parentheses (r/p/w) are included in the total clock cycle number. all timing data assumes two-clock reads and writes. when using this table, begin at the top and move downward. use the first entry that matches both source and destination addressing modes. 5.7.2.4 special-purpose move instruction. the special-purpose move instruc- tion table indicates the number of clock periods needed for the processor to fetch, calculate, and perform the special-purpose move operation on control registers or a specified ea. footnotes indicate when to account for the appropriate ea times. the total number of clock cycles is outside the parentheses. the numbers inside parentheses (r/p/w) are included in the total clock cycle number. all timing data assumes two-clock reads and writes. instruction head tail cycles move rn, rn 0 0 2(0/1/0) move fea , rn 0 0 2(0/1/0) move rn, (am) 0 2 4(0/1/x) move rn, (am) + 1 1 5(0/1/x) move rn, - (am) 2 2 6(0/1/x move rn, cea 1 3 5(0/1/x) move fea , (an) 2 2 6(0/1/x move fea , (an) + 2 2 6(0/1/x) move fea , - (an) 2 2 6(0/1/x) move #, cea 2 2 6(0/1/x * move cea , fea 2 2 6(0/1/x) x = there is one bus cycle for byte and word operands and two bus cycles for long-word oper- ands. for long-word bus cycles, add two clocks to the tail and to the number of cycles. timing is calculated with the cpu32+ in 16-bit mode. * = an # fetch ea time must be added for this instruction: fea ?+ cea ?+ oper note: for instructions not explicitly listed, use the move cea , fea entry. the source ea is calculated by the calculate ea table, and the destination ea is calculated by the fetch ea table, even though the bus cycle is for the source ea.
cpu32+ motorola mc68360 user? manual 5-93 5.7.2.5 arithmetic/logic instructions. the arithmetic/logic instruction table indi- cates the number of clock periods needed to perform the specified arithmetic/logical instruc- tion using the specified addressing mode. footnotes indicate when to account for the appropriate ea times. the total number of clock cycles is outside the parentheses. the num- instruction head tail cycles exg rn, rm 2 0 4(0/1/0) movec cr, rn 10 0 14(0/2/0) movec rn, cr 12 0 14-16(0/1/0) move ccr, dn 2 0 4(0/1/0) move ccr, cea 0 2 4(0/1/1) move dn, ccr 2 0 4(0/1/0) move fea , ccr 0 0 4(0/1/0) move sr, dn 2 0 4(0/1/0) move sr, cea 0 2 4(0/1/1) move dn, sr 4 - 2 10(0/3/0) move fea , sr 0 - 2 10(0/3/0) movem.w cea , rl 1 0 8 + n ? 4(n + 1, 2, 0) * movem.wrl, cea 10 8 + n ? 4(0, 2, n) * movem.l cea , rl 1 0 12 + n ? 4(2n + 2, 2, 0) movem.lrl, cea 1210 + n ? 4 (0, 2, 2n) movep.wdn, (d 16 , an) 2 0 10(0/2/2) movep.w(d 16 , an), dn 1 2 11(2/2/0) movep.ldn, (d 16 , an) 2 0 14(0/2/4) movep.l(d 16 , an), dn 1 2 19(4/2/0) moves (save) cea , rn 1 1 3(0/1/0) moves (op) cea , rn 7 1 11(x/1/0) moves (save)rn, cea 1 1 3(0/1/0) moves (op)rn, cea 9 2 12(0/1/x) move usp, an 0 0 2(0/1/0) move an, usp 0 0 2(0/1/0) swap dn 4 0 6(0/1/0) x = there is one bus cycle for byte and word operands and two bus cycles for long operands. for long bus cycles, add two clocks to the tail and to the number of cycles. * = each bus cycle may take up to four clocks without increasing total execution time. cr = control registers usp, vbr, sfc, and dfc n = number of registers to transfer rl = register list <= maximum time (certain data or mode combinations may execute faster). notes: 1. the moves instruction has an additional save step that other instructions do not have. to calculate the total instruction time, calculate the save, the ea, and the operation execution times, and combine in the order listed, using the equations given in 5.7.1 resource schedul- ing. 2. timing is calculated with the cpu32+ in 16-bit mode.
cpu32+ 5-94 mc68360 user? manual motorola bers inside parentheses (r/p/w) are included in the total clock cycle number. all timing data assumes two-clock reads and writes. instruction head tail cycles add(a) rn, rm 0 0 2(0/1/0) add(a) fea , rn 0 0 2(0/1/0) add dn, fea 0 3 5(0/1/x) and dn, dm 0 0 2(0/1/0) and fea , dn 0 0 2(0/1/0) and dn, fea 0 3 5(0/1/x) eor dn, dm 0 0 2(0/1/0) eor dn, fea 0 3 5(0/1/x) or dn, dm 0 0 2(0/1/0) or fea , dn 0 0 2(0/1/0) or dn, fea 0 3 5(0/1/x) sub(a) rn, rm 0 0 2(0/1/0) sub(a) fea , rn 0 0 2(0/1/0) sub dn, fea 0 3 5(0/1/x) cmp(a) rn, rm 0 0 2(0/1/0) cmp(a) fea , rn 0 0 2(0/1/0) cmp2 (save) * fea , rn 1 1 3(0/1/0) cmp2 (op) fea , rn 2 0 16-18(x/1/0) mul(su).w fea , dn 0 0 26(0/1/0) mul(su).l (save) * fea , dn 1 1 3(0/1/0) mul(su).l (op) fea , dl 2 0 46-52(0/1/0) mul(su).l (op) fea , dn:dl 2 0 46(0/1/0) divu.w fea , dn 0 0 32(0/1/0) divs.w fea , dn 0 0 42(0/1/0) divu.l (save) * fea , dn 1 1 3(0/1/0) divu.l (op) fea , dn 2 0 <46(0/1/0) divs.l (save) * fea , dn 1 1 3(0/1/0) divs.l (op) fea , dn 2 0 <62(0/1/0) tbl(su) dn:dm, dp 26 0 28-30(0/2/0) tbl(su) (save) * cea , dn 1 1 3(0/1/0) tbl(su) (op) cea , dn 6 0 33-35(2x/1/0) tblsn dn:dm, dp 30 0 30-34(0/2/0) tblsn (save) * cea , dn 1 1 3(0/1/0) tblsn (op) cea , dn 6 0 35-39(2x/1/0) tblun dn:dm, dp 30 0 34-40(0/2/0) tblun (save) * cea , dn 1 1 3(0/1/0) tblun (op) cea , dn 6 0 39-45(2x/1/0)
cpu32+ motorola mc68360 user? manual 5-95 5.7.2.6 immediate arithmetic/logic instructions. the immediate arithmetic/ logic instruction table indicates the number of clock periods needed for the processor to fetch the source immediate data value and to perform the specified arithmetic/logic instruc- tion using the specified addressing mode. footnotes indicate when to account for the appro- priate fetch effective or fetch immediate ea times. the total number of clock cycles is outside the parentheses. the numbers inside parentheses (r/p/w) are included in the total clock cycle number. all timing data assumes two-clock reads and writes. 5.7.2.7 binary-coded decimal and extended instructions. the bcd and extended instruction table indicates the number of clock periods needed for the processor to perform the specified operation using the specified addressing mode. no additional tables are needed to calculate total effective execution time for these instructions. the total number of clock cycles is outside the parentheses. the numbers inside parentheses (r/p/w) are included in the total clock cycle number. all timing data assumes two-clock reads and writes. x = there is one bus cycle for byte and word operands and two bus cycles for long operands. for long bus cycles, add two clocks to the tail and to the number of cycles. timing is calculated with the cpu32+ in 16-bit mode. < = maximum time (certain data or mode combinations may execute faster). su = the execution time is identical for signed or unsigned operands. * = these instructions have an additional save operation that other instructions do not have. to calculate total instruction time, calculate save, ea , and operation execution times, then combine in the order listed, using equations in 5.7.1.6 instruction execution time calculation. a save operation is not run for long-word divide and multiply instructions when fea = dn. instruction head tail cycles moveq#, dn 0 0 2(0/1/0) addq #, rn 0 0 2(0/1/0) addq #, fea 0 3 5(0/1/x) subq #, rn 0 0 2(0/1/0) subq #, fea 0 3 5(0/1/x) addi #, rn 0 0 2(0/1/0) * addi #, fea 0 3 5(0/1/x) * andi #, rn 0 0 2(0/1/0) * andi #, fea 0 3 5(0/1/x) * eori #, rn 0 0 2(0/1/0) * eori #, fea 0 3 5(0/1/x) * ori #, rn 0 0 2(0/1/0) * ori #, fea 0 3 5(0/1/x) * subi #, rn 0 0 2(0/1/0) * subi #, fea 0 3 5(0/1/x) * cmpi #, rn 0 0 2(0/1/0) * cmpi #, fea 0 3 5(0/1/x) * x = there is one bus cycle for byte and word operands and two bus cycles for long-word op- erands. for long-word bus cycles, add two clocks to the tail and to the number of cycles. timing is calculated with the cpu32+ in 16-bit mode. * = an # fetch ea time must be added for this instruction: fea ?+ fea ?+ oper
cpu32+ 5-96 mc68360 user? manual motorola 5.7.2.8 single operand instructions. the single operand instruction table indi- cates the number of clock periods needed for the processor to perform the specified opera- tion using the specified addressing mode. the total number of clock cycles is outside the parentheses. the numbers inside parentheses (r/p/w) are included in the total clock cycle number. all timing data assumes two-clock reads and writes. 5.7.2.9 shift/rotate instructions. the shift/rotate instruction table indicates the number of clock periods needed for the processor to perform the specified operation on the given addressing mode. footnotes indicate when to account for the appropriate ea times. the number of bits shifted does not affect the execution time, unless noted. the total num- instruction head tail cycles abcd dn, dm 2 0 4(0/1/0) abcd - (an), - (am) 2 2 12(2/1/1) sbcd dn, dm 2 0 4(0/1/0) sbcd - (an), - (am) 2 2 12(2/1/1) addx dn, dm 0 0 2(0/1/0) addx - (an), - (am) 2 2 10(2/1/1) subx dn, dm 0 0 2(0/1/0) subx - (an), - (am) 2 2 10(2/1/1) cmpm (an)+, (am)+ 1 0 8(2/1/0) instruction head tail cycles clr dn 0 0 2(0/1/0) clr cea 0 2 4(0/1/x) neg dn 0 0 2(0/1/0) neg fea 0 3 5(0/1/x) negx dn 0 0 2(0/1/0) negx fea 0 3 5(0/1/x) not dn 0 0 2(0/1/0) not fea 0 3 5(0/1/x) ext dn 0 0 2(0/1/0) nbcd dn 2 0 4(0/1/0) nbcd fea 0 2 6(0/1/1) scc dn 2 0 4(0/1/0) scc cea 2 2 6(0/1/1) tas dn 4 0 6(0/1/0) tas cea 1 0 10(0/1/1) tst fea 0 0 2(0/1/0) x = there is one bus cycle for byte and word operands and two bus cycles for long-word operands. for long-word bus cycles, add two clocks to the tail and to the number of cycles. timing is calculated with the cpu32+ in 16-bit mode
cpu32+ motorola mc68360 user? manual 5-97 ber of clock cycles is outside the parentheses. the numbers inside parentheses (r/p/w) are included in the total clock cycle number. all timing data assumes two-clock reads and writes. 5.7.2.10 bit manipulation instructions. the bit manipulation instruction table indi- cates the number of clock periods needed for the processor to perform the specified opera- tion on the given addressing mode. the total number of clock cycles is outside the parentheses. the numbers inside parentheses (r/p/w) are included in the total clock cycle number. all timing data assumes two-clock reads and writes. instruction head tail cycles note lsd dn, dm - 2 0 (0/1/0) 1 lsd #, dm 4 0 6(0/1/0) lsd fea 0 2 6(0/1/1) asd dn, dm - 2 0 (0/1/0) 1 asd #, dm 4 0 6(0/1/0) asd fea 0 2 6(0/1/1) rod dn, dm - 2 0 (0/1/0) 1 rod #, dm 4 0 6(0/1/0) rod fea 0 2 6(0/1/1) roxd dn, dm - 2 0 (0/1/0) 2 roxd #, dm - 2 0 (0/1/0) 3 roxd fea 0 2 6(0/1/1) d = direction (left or right) notes: 1. head and cycle times can be derived from the following table or calculated as follows: max (3 + (n/4) + mod(n,4) + mod (((n/4) + mod (n,4) + 1,2), 6) 2. head and cycle times are calculated as follows: (count 63): max (3 + n + mod (n + 1,2), 6). 3. head and cycle times are calculated as follows: (count 8): max (2 + n + mod (n,2), 6). 4. timing is calculated with the cpu32+ in 16-bit mode. clocks shift counts 6 01234568912 8 7 10 11 13 14 16 17 20 10 15 18 19 21 22 24 25 28 12 23 26 27 29 30 32 33 36 14 31 34 35 37 38 40 41 44 16 39 42 43 45 46 48 49 52 18 47 50 51 53 54 56 57 60 20 55 58 59 61 62 22 63
cpu32+ 5-98 mc68360 user? manual motorola 5.7.2.11 conditional branch instructions. the conditional branch instruction timing table indicates the number of clock periods needed for the processor to perform the specified branch on the given branch size, with complete execution times given. no addi- tional tables are needed to calculate total effective execution time for these instructions. the total number of clock cycles is outside the parentheses. the numbers inside parentheses (r/ p/w) are included in the total clock cycle number. all timing data assumes two-clock reads and writes. instruction head tail cycles bchg #, dn 2 0 6(0/2/0) * bchg dn, dm 4 0 6(0/1/0) bchg #, fea 1 2 8(0/2/1) * bchg dn, fea 2 2 8(0/1/1) bclr #, dn 2 0 6(0/2/0) * bclr dn, dm 4 0 6(0/1/0) bclr #, fea 1 2 8(0/2/1) * bclr dn, fea 2 2 8(0/1/1) bset #, dn 2 0 6(0/2/0) * bset dn, dm 4 0 6(0/1/0) bset #, fea 1 2 8(0/2/1) * bset dn, fea 2 2 8(0/1/1) btst #, dn 2 0 4(0/2/0) * btst dn, dm 2 0 4(0/1/0) btst #, fea 1 0 4(0/2/0) * btst dn, fea 2 0 8(0/1/0) * = an # fetch ea time must be added for this instruction: fea ?+ fea ?+ oper timing is calculated with the cpu32+ in 16-bit mode. instruction head tail cycles bcc (taken) 2 - 2 8(0/2/0) bcc.b (not taken) 2 0 4(0/1/0) bcc.w (not taken) 0 0 4(0/2/0) bcc.l (not taken) 0 0 6(0/3/1) dbcc (t, not taken) 1 1 4(0/2/0) dbcc (f, - 1, not taken) 2 0 6(0/2/0) dbcc (f, not - 1, taken) 6 - 2 10(0/2/0) dbcc (t, not taken) 4 0 6(0/1/0) * dbcc (f, - 1, not taken) 6 0 8(0/1/0) * dbcc (f, not - 1, taken) 6 0 10(0/0/0) * * = in loop mode timing is calculated with the cpu32+ in 16-bit mode.
cpu32+ motorola mc68360 user? manual 5-99 5.7.2.12 control instructions. the control instruction table indicates the number of clock periods needed for the processor to perform the specified operation on the given addressing mode. footnotes indicate when to account for the appropriate ea times. the total number of clock cycles is outside the parentheses. the numbers inside parentheses (r/ p/w) are included in the total clock cycle number. all timing data assumes two-clock reads and writes. instruction head tail cycles andi #, sr 0 - 2 12(0/2/0) eori #, sr 0 - 2 12(0/2/0) ori #, sr 0 - 2 12(0/2/0) andi #, ccr 2 0 6(0/2/0) eori #, ccr 2 0 6(0/2/0) ori #, ccr 2 0 6(0/2/0) bsr.b 3 - 2 13(0/2/2) bsr.w 3 - 2 13(0/2/2) bsr.l 1 - 2 13(0/2/2) chk fea , dn (no ex) 2 0 8(0/1/0) chk fea , dn (ex) 2 - 2 42(2/2/6) chk2 (save) fea , dn (no ex) 1 1 3(0/1/0) chk2 (op) fea , dn (no ex) 2 0 18(x/0/0) chk2 (save) fea , dn (ex) 1 1 3(0/1/0) chk2 (op) fea , dn (ex) 2 - 2 52(x + 2/1/6) jmp cea 0 - 2 6(0/2/0) jsr cea 3 - 2 13(0/2/2) lea cea , an 0 0 2(0/1/0) link.w an, # 2 0 10(0/2/2) link.l an, # 0 0 10(0/3/2) nop 0 0 2(0/1/0) pea cea 0 0 8(0/1/2) rtd # 1 - 2 12(2/2/0) rtr 1 - 2 14(3/2/0) rts 1 - 2 12(2/2/0) unlk an 1 0 9(2/1/0) x = there is one bus cycle for byte and word operands and two bus cycles for long-word operands. for long-word bus cycles, add two clocks to the tail and to the number of cycles. timing is calculated with the cpu32+ in 16-bit mode. note: the chk2 instruction involves a save step that other instructions do not have. to cal- culate the total instruction time, calculate the save, the ea, and the operation execution times; then combine in the order listed using the equations given in 5.7.1 resource scheduling.
cpu32+ 5-100 mc68360 user? manual motorola 5.7.2.13 exception-related instructions and operations. the exception- related instructions and operations table indicates the number of clock periods needed for the processor to perform the specified exception-related actions. no additional tables are needed to calculate total effective execution time for these instructions. the total number of clock cycles is outside the parentheses. the numbers inside parentheses (r/p/w) are included in the total clock cycle number. all timing data assumes two-clock reads and writes. instruction head tail cycles bkpt (acknowledged) 0 0 14(1/0/0) bkpt (bus error) 0 - 2 35(3/2/4) breakpoint (acknowledged) 0 0 10(1/0/0) breakpoint (bus error) 0 - 2 42(3/2/6) interrupt 0 - 2 30(3/2/4) * reset 0 0 518(0/1/0) stop 2 0 12(0/1/0) lpstop 3 - 2 25(0/3/1) divide-by-zero 0 - 2 36(2/2/6) trace 0 - 2 36(2/2/6) trap # 4 - 2 29(2/2/4) illegal 0 - 2 25(2/2/4) a-line 0 - 2 25(2/2/4) f-line (first word illegal) 0 - 2 25(2/2/4) f-line (second word illegal) ea = rn 1 - 2 31(2/3/4) f-line (second word illegal) ea rn (save) 1 1 3(0/1/0) f-line (second word illegal) ea rn (op) 4 - 2 29(2/2/4) privileged 0 - 2 25(2/2/4) trapcc (trap) 2 - 2 38(2/2/6) trapcc (no trap) 2 0 4(0/1/0) trapcc.w (trap) 2 - 2 38(2/2/6) trapcc.w (no trap) 0 0 4(0/2/0) trapcc.l (trap) 0 - 2 38(2/2/6) trapcc.l (no trap) 0 0 6(0/3/0) trapv (trap) 2 - 2 38(2/2/6) trapv (no trap) 2 0 4(0/1/0) * = minimum interrupt acknowledge cycle time is assumed to be three clocks. timing is calculated with the cpu32+ in 16-bit mode. note: the f-line (second word illegal) operation involves a save step which other operations do not have. to calculate the total operation time, calculate the save, the calculate ea, and the operation execution times, and combine in the order listed, using the equations given in 5.7.1.6 instruction execution time calculation.
cpu32+ motorola mc68360 user? manual 5-101 5.7.2.14 save and restore operations. the save and restore operations table indicates the number of clock periods needed for the processor to perform the specified state save or return from exception. complete execution times and stack length are given. no additional tables are needed to calculate total effective execution time for these instruc- tions. the total number of clock cycles is outside the parentheses. the numbers inside parentheses (r/p/w) are included in the total clock cycle number. all timing data assumes two-clock reads and writes. instruction head tail cycles berr on instruction 0 - 2 < 58(2/2/12) berr on exception 0 - 2 48(2/2/12) rte (four-word frame) 1 - 2 24(4/2/0) rte (six-word frame) 1 - 2 26(4/2/0) rte (berr on instruction) 1 - 2 50(12/12/y) rte (berr on four-word frame) 1 - 2 66(10/2/4) rte (berr on six-word frame) 1 - 2 70(12/2/6) y = if a bus error occurred during a write cycle, the cycle is rerun by the rte. < = maximum time is indicated (certain data or mode combinations execute faster). timing is calculated with the cpu32+ in 16-bit mode.
cpu32+ 5-102 mc68360 user? manual motorola
motorola mc68360 user? manual 6-1 section 6 system integration module (sim60) the quicc's system integration module (sim60) consists of a number of functions that con- trol system startup, system initialization, the external system bus, and the external system peripherals. the sim60 functions include the following: module base address register (mbar) system configuration and protection new low-power standby modes with slow-go option clock synthesizer with skew elimination breakpoint logic slave mode including mc68040 companion mode external bus interface (ebi) control memory controller supports eight banks of dram, sram, eprom, or peripherals dynamic bus sizing external master support bus arbitration ieee 1149.1 test access port 6.1 module overview the sim60 on the quicc device is an enhanced version of the sim40 that is implemented on another m68300 family device called the mc68340. the italicized items show the main areas of enhancement. to a large extent, the other features are still compatible with the older sim40. the mbar provides the base address for all accesses to the sim60 and every other on-chip resource. the system configuration and protection function controls the overall system configuration and provides various monitors and timers, including the internal bus monitor, double bus fault monitor, spurious interrupt monitor, software watchdog timer, periodic interrupt timer, low-power stop support, and freeze support. the clock synthesizer generates the clock signals used by the sim60 as well as other mod- ules and external devices. this circuitry can generate the system clock from an inexpensive 32.768-khz watch crystal. thi d t t d ith f m k 4 0 4
system integration module (sim60) 6-2 mc68360 user? manual motorola the sim60 has additional support of low-power modes. the clock synthesizer provides sys- tem clocks to the sim60 and other modules. this clock scheme supports low-power modes for applications that use the baud rate generators and/or serial ports during the standby mode. the main system clock can be changed dynamically (the slow-go option) while the baud rate generators and serial ports work with a fixed frequency. the breakpoint logic provides an internal breakpoint address register that allows hardware breakpoints in a quicc system. this function is especially useful during in-field debugging activity when it is difficult to connect an in-circuit emulator or logic analyzer to the target board. the quicc supports the slave mode. in this mode, the cpu32+ core on the quicc is dis- abled, and the quicc functions as an intelligent peripheral. for instance, if the application requires more serial channels than the quicc provides, multiple quiccs may be config- ured onto the same system bus, one with its cpu enabled and the rest in slave mode. alter- natively, if the application needs additional cpu performance, the quicc may function as a companion chip to an mc68ec040 (or other m68040 family member). this is called mc68040 companion mode. in this mode, the quicc's glueless interface to the mc68ec040 provides a two-chip mc68ec040 system solution. the mc68ec040 can also control multiple quiccs in slave mode. finally, the quicc slave mode may also support an external mc68ec030 or other m68030 family member. the ebi handles the transfer of information between the internal cpu32+ core and memory, peripherals, or other processing elements in the external address space, or between an external master and the quicc ram and registers. section 4 bus operation describes the bus operation, but the configuration control of the ebi is contained in this section. the following functions are physically part of the sim60, but are described in other places in this manual. the memory controller module provides glueless interfaces to many types of memory and peripherals. it contains up to 8 general-purpose chip selects with up to 15 wait states each and a full dram controller that controls up to 8 dram banks. see 6.10 memory controller for further information. the quicc dynamically interprets the bus port size of an addressed device during each bus cycle, allowing operand transfers to/from 8-, 16-, and 32-bit ports. the dsack signals are used to signify the data port size. dynamic bus sizing can result in reduced system cost. for instance, an 8-bit boot eprom may be used with 16-bit peripherals and 32-bit dram. dynamic bus sizing also allows a programmer to write code that is not bus-width specific. for a discussion on dynamic bus sizing see section 4 bus operation. the quicc is designed to allow external bus masters the opportunity to access the inter- module bus (imb). this design has two main purposes. first, the ram and peripherals on the quicc can be directly accessed, if desired, by an external master. second, the external master can use quicc resources, such as the chip-select generation logic and dram con- troller. see section 4 bus operation for further discussion.
system integration module (sim60) motorola mc68360 user? manual 6-3 the quicc also provides the ability to request and obtain mastership of the system bus. this logic is only reset during a power-on reset and is active at all other times. see section 4 bus operation for further discussion. the quicc includes dedicated user-accessible test logic that is fully compliant with the ieee 1149.1 standard test access port and boundary scan architecture. this standard was developed under the sponsorship of the ieee test technology committee and joint test action group (jtag). the quicc implementation supports circuit-board test strate- gies based on this standard. refer to section 8 scan chain test access port for additional information. the following paragraphs describe the operation of the mbar, system configuration and protection, clock synthesizer, breakpoint logic, slave mode, and ebi control. 6.2 module base address register (mbar) the mbar controls the location of all module registers (see 6.9.1 module base address register (mbar)). the address stored in this register is the base address (starting location) for the internal module registers. all internal module registers and ram occupy a single 8- kbyte memory block (see figure 6-1) that is relocatable along 8-kbyte boundaries. the loca- tion of the internal registers is fixed by writing the desired base address of the 8-kbyte block to the mbar using the moves instruction to address $0003ff00 in cpu space. the source function code (sfc) and destination function code (dfc) registers contain the address space values (fc2?c0) for the read or write operand of the moves instruction (see section 5 cpu32+ or m68000pm/ad, programmer? reference manual ). therefore, the sfc or dfc register must indicate cpu space (fc2?c0 = $7), using the movec instruction, before accessing the mbar. 6.3 system configuration and protection the sim60 allows the user to control certain features of system configuration by writing bits in the module configuration register (mcr). all m68000 family members are designed to provide maximum system safeguards. as an extension of the family, the quicc promotes the same basic concepts of safeguarded design present in all m68000 members. in addition, many functions that normally must be provided in external circuits are incorporated in this device. the following features are pro- vided in the system configuration and protection sub-module: sim60 configuration the sim60 allows the user to configure the system according to the particular require- ments. the functions include control of slave mode (disable cpu32+) operation, freeze and show cycle operation, the access privilege of the supervisor/user registers, the level of interrupt arbitration, and automatic autovectoring for external interrupts. reset status the reset status register provides the user with information on the cause of the most re- cent reset. the possible causes include external, power-up, software watchdog, double bus fault, loss of clock, and the reset instruction.
system integration module (sim60) 6-4 mc68360 user? manual motorola figure 6-1. quicc memory map bus monitor the sim60 provides a bus monitor to monitor the data and size acknowledge (dsack ) response time for all bus accesses (internal-to-internal, internal-to-external, external-to- internal, and external-to-external). four selectable response times allow for variations in response speed of memory and peripherals used in the system. a bus error signal is as- serted if the dsack response limit is exceeded. this function can be disabled. note on the mc68302, this function is called the hardware watchdog. double bus fault monitor the double bus fault monitor causes a reset to occur if the internal halt signal is assert- ed by the cpu32+, indicating a double bus fault. a double bus fault results when a bus or address error occurs during the exception processing sequence for a previous bus or ad- dress error, a reset, or while the cpu32+ is loading information from a bus error stack frame during an rte instruction. this function can be disabled. see section 4 bus oper- ation for more information. internal registers 4 kb 4 kb mbar (sim60) regb (register base) = dprbase + 4k dprbase (dual-port ram base) dual-port ram
system integration module (sim60) motorola mc68360 user? manual 6-5 spurious interrupt monitor if no interrupt arbitration occurs during an interrupt acknowledge cycle, the bus error sig- nal is asserted internally. software watchdog timer (swt) the swt asserts a reset or level 7 interrupt (as selected by the system protection control register (sypcr)) if the software fails to service the swt for a designated period of time (i.e., because the software is trapped in a loop or lost). there are eight selectable timeout periods. after a system reset, this function is enabled, selects a timeout of approximately 1 second, and asserts a system reset if the timeout is reached. the swt may be disabled, or its timeout period may be changed in the sypcr; however, once sypcr is written, it cannot be written again until a system reset. this mechanism is used to ensure the proper operation of the swt. periodic interrupt timer (pit) the sim60 provides a timer to generate periodic interrupts for use with a real-time oper- ating system or the application software. the pit period can vary from 122 ms to 15.94 s (assuming a 32.768-khz crystal is used to generate the general system clock). this func- tion can be disabled. freeze support the sim60 allows control of whether the swt and pit should continue to run during freeze mode. low-power stop support when executing the lpstop instruction, the quicc can provide reduced power con- sumption with only the sim60 remaining active. low-power standby support in addition to the low-power stop support, the quicc can provide low power consumption while other modules or sub-modules are functioning. in this mode, the baud rate genera- tors and serial ports run with a fixed frequency while the rest of the chip (including the sim60) runs with a divided clock. figure 6-2 shows a block diagram of the system configuration and protection logic. 6.3.1 system configuration many aspects of the system configuration are controlled by the mcr. for debug purposes, accesses to internal peripherals can be shown on the external bus. this function is called show cycles. the shen1, shen0 bits in the mcr control the show cycles. external bus arbitration can be either enabled or disabled during show cycles. the sim60 provides eight bus arbitration levels for determining the priority of bus access (0 7). the sim60 is fixed at the highest level (level 7). the cpu32+ is fixed at the lowest level (level 0). only the sim60, the cpu32+, the two-channel independent direct memory access (idma), and the serial direct memory access (sdma) can be bus masters and arbitrate for
system integration module (sim60) 6-6 mc68360 user? manual motorola the bus. (the idma and sdma have the ability to configure their bus arbitration level as described in section 7 communication processor module (cpm)). figure 6-2. system configuration and protection logic 6.3.1.1 sim60 interrupt generation. an overview of the quicc interrupt structure is shown in figure 6-3. the lower half of the figure shows the sim60. the sim60 receives interrupts from internal sources, such as the swt and pit, and external sources, such as the irq7 ?rq1 lines. if it generates an interrupt, the swt always uses level 7; the pit may use any level. the irqx pins choose the interrupt level associated with the pin (i.e., irq1 generates a level 1 interrupt, etc.). in addition, the cpm block may choose any level (1?) for its interrupts. the imb architecture allows multiple interrupt sources to safely exist at the same level, a process called interrupt arbitration. once an interrupt acknowledge cycle occurs at the inter- rupt level that matches a pending interrupt request, interrupt arbitration begins on the imb. the interrupt arbitration process is designed to choose between multiple requests at the same level. for instance, if the pit request is at level 4 but the cpm simultaneously is requesting an interrupt at level 4, an interrupt arbitration process is required to decide who wins the interrupt. (the interrupt arbitration process does not affect users who assign all interrupt sources in the system to a unique interrupt level (1?)). software watchdog periodic interrupt timer clock reset status 2 prescaler 9 module configuration bus monitor spurious interrupt monitor double bus fault monitor system reset internal berr is signaled system reset or level 7 interrupt level 1 to 7 interrupt
system integration module (sim60) motorola mc68360 user? manual 6-7 figure 6-3. quicc interrupt structure in the interrupt arbitration process, the module places its arbitration id on the imb. the arbi- tration id ranges in value from 0 to 15. the sim60 interrupt controller arbitration id is initial- ized to 15 (the highest value), but may be lowered if desired. the higher arbitration value always wins. cpm priority resolver request to the imb at programmable level (1?) port c11?ort c0 timer1 timer2 timer3 timer4 scc1 scc2 scc3 scc4 smc1 smc2 spi pip idma1 idma2 sdma bus error risc timer table 12 32-bit cpm interrupt pending register (cpir) cpm vector generation logic interrupt arbitration id is fixed at level 8 8-bit interrupt vector (lower 5 bits fixed, upper 3 bits programmable) 8 intermodule bus (imb) interrupt sources communication processor module (cpm) periodic interrupt timer (pit) software watchdog timer (swt) external to quicc irq7?rq1 7 sim60 interrupt control request to the imb level (1?) interrupt arbitration id is initially 15 (programmable) pit vector generation swt vector generation autovector generation 8-bit interrupt vector avec signal 8 quicc slave mode interrupt logic system integration module (sim60) iout2?out0 rqout 3 iack7?ack1 6 avec aveco
system integration module (sim60) 6-8 mc68360 user? manual motorola notes at system reset, the sim60 has a higher priority (at the same in- terrupt level) than the cpm. this priority can be changed if the sim60 value is written to be less than 8, the level of the cpm. no two modules are allowed to have the same interrupt arbitra- tion value. assuming that the pit wins the arbitration process, the sim60 places the pit 8-bit vector on the bus. the swt also has a user-defined interrupt vector. the pit and swt interrupts do not allow autovectors. the irqx lines can be vectored (externally supplied) or autovectored. arbitration for servicing interrupts is controlled by the value programmed into the interrupt arbitration (iarb) field of the mcr. because no two modules are allowed to share the same iarb value and the only other module that generates interrupts (the cpm) has a fixed iarb value (iarb = 8), the sim60 iarb value should be programmed to a value between 1 and 7 or between 9 and 15. the autovector register (avr) contains bits that correspond to external interrupt levels that require an autovector response. the sim60 supports up to seven discrete external interrupt requests. if the bit corresponding to an interrupt level is set in the avr, the sim60 returns an internal autovector in response to the interrupt acknowledge cycle servicing that external interrupt request. otherwise, external circuitry must either return an interrupt vector or exter- nally assert the external avec signal. see 6.8.4 interrupts in slave mode for more information. 6.3.1.2 simultaneous sim60 interrupt sources. if the possible level 7 interrupt sources in the sim60 are simultaneously asserted, the sim60 will prioritize and service the interrupts in the following order: 1) swt, 2) pit, and 3) external interrupts. at level 6 or less, the pit is higher than an external interrupt request asserted at the same level as the pit. 6.3.1.2.1 bus monitor. the bus monitor ensures that each bus cycle is terminated within a reasonable period of time. it continually checks the duration of the internal/external as line (ts for 68040). as is normally negated by dsackx , berr , (ta or tea for 68040).or halt (or avec during an interrupt acknowledge cycle) the bus monitor asserts berr if the response time is excessive on any bus cycle including interrupt acknowledge cycles. the bme bit in the sypcr enables the bus monitor. the bus cycle termination response time is measured in clock cycles, and the maximum- allowable response time is programmable. the bus monitor response time period ranges from 128 to 1k system clocks (see table 6-5). the value chosen by the user should be larger than the longest possible response time of the slowest peripheral in the system. 6.3.1.2.2 spurious interrupt monitor. in normal interrupt handling, one or more internal sub-modules recognize the cpu32+ interrupt acknowledge cycle as a signal that the cpu32+ is responding to their interrupt requests. the sub-modules then arbitrate for the privilege of returning a vector or asserting avec to the cpu32+. (the sim60 also performs
system integration module (sim60) motorola mc68360 user? manual 6-9 internal interrupt arbitration on behalf of any irqx pins that are asserted externally.) if, how- ever, no internal sub-module participates in the internal interrupt arbitration process, the spurious interrupt monitor takes action by issuing the berr signal internally. this causes the cpu32+ to terminate the cycle with a spurious interrupt vector. this feature cannot be disabled. 6.3.1.2.3 double bus fault monitor. a double bus fault is caused by a bus error or address error during the exception processing sequence. the double bus fault monitor responds to an assertion of halt on the internal bus by initiating a system reset. refer to section 4 bus operation for more information. the dbf bit in the reset status register indi- cates that the last reset was caused by the double bus fault monitor. the double bus fault monitor reset can be enabled by the dbfe bit in the sypcr. 6.3.1.2.4 software watchdog timer (swt). the sim60 provides the swt option to pre- vent system lockup in case the software becomes trapped in loops with no controlled exit. the swt is enabled after system reset to cause a system reset if it times out. if swt is not desired, the user must clear the swe bit in the sypcr to disable it. if used, the swt requires a special service sequence to be executed on a periodic basis. if this periodic ser- vicing action does not occur, the swt times out and issues a reset or a level 7 interrupt (as programmed by the swri bit in the sypcr). once the sypcr is written by software, the state of the swt (enabled or disabled) cannot be changed. the address of the interrupt ser- vice routine for the swt interrupt is stored in the software interrupt vector register (swiv). figure 6-4 shows a block diagram of the swt as well as the clock control circuits for the pit. the swt clock rate is determined by the swp bit in the periodic interrupt timer register (pitr) and the swt bits in the sypcr. when modck1 is low (an external oscillator is used), the 512 (2 9 ) prescaler is enabled, and the swp and ptp bits in the pitr are set. see table 6-4 for a list of swt timeout periods. the swt service sequence consists of the following two steps: write $55 to the software service register (swsr) and write $aa to the swsr. both writes must occur in the order listed prior to the swt timeout, but any number of instructions or accesses to the swsr can be executed between the two writes. this allows interrupts and exceptions to occur, if necessary, between the two writes. figure 6-4. swt and pit block diagram clock disable prescaler (2 ) clock mux 15 stage divider chain (2 ) lpstop swp ptp frz1 swclk pitclk preclk 9 15 22 22 9 11 13 15 reset or level 7 interrupt 4 modulus counter pit interrupt pitr spclk from clock synthesizer
system integration module (sim60) 6-10 mc68360 user? manual motorola 6.3.2 periodic interrupt timer (pit) the pit consists of an 8-bit modulus counter that is loaded with the value contained in the pitr (see table 6-4). the modulus counter is clocked by the spclk signal derived from the extal pin (either extal or extal divided by 128 as determined by the modck1 modck0 pins). when modck1 is low (an external oscillator is used), the 512 (2 9 ) pres- caler is enabled, and the swp and ptp bits in the pitr are set. the clock source is divided by 4 before driving the modulus counter (pitclk). when the modulus counter value reaches zero, an interrupt is generated. the level of the generated interrupt is programmed into the pirql bits in the periodic interrupt control register (picr). during the interrupt acknowledge cycle, the sim60 places the periodic interrupt vector, pro- grammed into the piv bits in the picr, onto the bus. the value of bits 7? in the pitr is then loaded again into the modulus counter, and the counting process starts over. if a new value is written to the pitr, this value is loaded into the modulus counter when the current count is complete. 6.3.2.1 pit period calculation. the period of the pit can be calculated using the fol- lowing equation: solving the equation using a crystal frequency of 32.768-khz with the prescaler disabled gives: this gives a range from 122 m s, with a pitr value of $01 (00000001 binary), to 31.128 ms, with a pitr value of $ff (11111111 binary). solving the equation with the prescaler enabled (ptp = 1) gives the following values: pitr count value pit period = spclk / prescaler value 2 2 pitr count value pit period = 32768/1 2 2 pit period = pitr count value 8192 pitr count value pit period = 32768/512 2 2
system integration module (sim60) motorola mc68360 user? manual 6-11 this gives a range from 62.5 ms, with a pitr value of $01, to 15.94 s, with a pitr value of $ff. for a fast calculation of pit period using a 32.768-khz crystal, the following equations can be used: with prescaler disabled: pit period = pitr (122 m s) with prescaler enabled: pit period = pitr (62.5 ms) 6.3.2.2 using the pit as a real-time clock. the pit can be used as a real-time clock interrupt by setting it up to generate an interrupt with a 1-second period. when using a 32.768-khz (or 4.192-mhz) crystal, the pitr should be loaded with a value of 16 decimal ($10) with the prescaler enabled to generate interrupts at a 1-sec rate. 6.3.3 freeze support freeze is asserted by the cpu32+ if a breakpoint is encountered with background mode enabled. refer to section 5 cpu32+ for more information on the background mode. when freeze is asserted, the double bus fault monitor and spurious interrupt monitor continue to operate normally. however, the swt, the bus monitor, and the pit may be affected. set- ting the frz1 bit in the mcr disables the swt and the pit when freeze is asserted. set- ting the frz0 bit in the mcr disables the bus monitor when freeze is asserted. if the config pins are configured with the cpu32+ core enabled, then one clock after reset is complete, the config2 pin will become the freeze output. thus, the pin will start driv- ing low one clock after reset. it will then be asserted (high) if the freeze condition occurs. if the config pins configure the quicc to slave mode, then the freeze output is not avail- able. 6.3.4 low-power stop support executing the lpstop instruction provides reduced power consumption when the quicc is idle, with only the sim remaining active. operation of the sim60 is controlled by the pllcr. lpstop disables the clock to the swt in the low state. the swt, which remains stopped until the lpstop mode is ended, begins to run again on the next rising clock edge. note when the cpu32+ executes the stop instruction (as opposed to lpstop), the swt continues to run. if the swt is enabled, it issues a reset or interrupt when its timeout occurs. pit period = pitr count value 16
system integration module (sim60) 6-12 mc68360 user? manual motorola the pit does not respond to an lpstop instruction; thus, it can be used to exit lpstop as long as the interrupt request level is higher than the cpu32+ interrupt mask level. to stop the pit while in lpstop, the pitr must be loaded with a zero value before lpstop is exe- cuted. the bus monitor, double bus fault monitor, and spurious interrupt monitor are all inac- tive during lpstop. if an external device requires additional time to prepare for entry into lpstop mode, entry can be delayed by asserting halt (see 4.4.2 lpstop broadcast cycle). note the idma channels should be disabled prior to issuing the lp- stop instruction. 6.4 low power in normal operation in addition to the lpstop mode, the sim60 supports methods to minimize power consump- tion in normal operation. in normal operation, the quicc provides several options to reduce power consumption: the sub-block clock generators are automatically disabled when the sub-block is not active. for example, when the risc controller is idle (no pending request is present from the serial channels), its clock generator is automatically stopped. in most of the imb sub-modules, there is a bit (e.g., stop or reset), that can disable the clock generator in that module (except for its imb interface unit). the sim60 also supports methods to reduce power by dividing the clocks internally. this is called slow-go mode and is described in 6.5 sim60 system clock generation. 6.5 sim60 system clock generation the quicc has an on-chip oscillator, a clock synthesizer, and a low-power divider, which allow a comprehensive set of choices in generating system clocks (see figure 6-5). the choices offer many opportunities to save power and system cost, without sacrificing flexibil- ity and control. the operation of the clocks is determined by three registers: the clock out control register (clkocr), the phase-locked loop control register (pllcr), and the clock divider control register (cdvcr). each register has a protection mechanism to prevent accidental writing. the clock generation features are discussed in the following paragraphs. 6.5.1 clock generation methods the first method drives the system clock at the desired system frequency (10?5 mhz), directly onto the extal pin. a second method drives the extal pin with a selected fre- quency which is pre-scaled and multiplied by the pll. with these two methods, the xtal pin should be left floating. a third method uses a reference crystal frequency which can also be pre-scaled and multiplied. this can be any frequency from 25 khz to 6.0 mhz. figure 6- 6 shows external connections required for the on-chip oscillator as well as the other clock- related v cc and gnd connections.
system integration module (sim60) motorola mc68360 user? manual 6-13 figure 6-5. system clocks schematic note user must select the proper modck configuration as well as correct xfc capacitor value when selecting the input clock fre- quency and desired system frequency. for more information on modck see 6.5.8 configuration pins (modck1?odck0). for more information on xfc see 10.8 external capacitor for pll. 6.5.2 oscillator prescaler (divide by 128) in some applications, the use of a ~ 32-khz crystal is attractive because of cost and low power, but is not attractive due to the extra startup time required for such a slow frequency crystal. therefore, the sim60 has an option for the user to provide a higher frequency crystal (for instance, in the ~ 4-mhz range) and divide it by 128 (back down to the 32-khz range) before it is used by the quicc. this results in much faster startup time than a 32-khz crys- tal, plus low cost (if a common 4.192-mhz frequency is chosen), with only a small impact on power consumption during low-power modes (since the ~4-mhz frequency is immediately modck1?odck0 multiplication factor (mf11?f0) divide values in cdvcr low-power dividers syncclk brgclk clko2 pin (normally 50 mhz) general system clock (normally 25 mhz) vco out (2x) (normally 50 mhz) clkin mux mux ?2 clko1 pin simclk (normally 25 mhz) stsim bit mux software watchdog and pit clock (spclk) divide by 128 extal osc. extal xtal modck1?odck0 extal extal/128 phase detector loop filter vco multiplication factor 1 to 4096 mf11?f0 clkin vco out (twice the system frequency) pll pll
system integration module (sim60) 6-14 mc68360 user? manual motorola divided prior to being used by any quicc on-chip module). furthermore, the divide-by-128 function allows the value of the final system frequency to be chosen with much greater pre- cision, since it is a multiple of ~32 khz rather than a multiple of ~4 mhz. the choice of whether to use the divide-by-128 function is made with the modck1 modck0 pins. this resulting frequency is called clkin. figure 6-6. external components 6.5.3 phase-locked loop (pll) the pll takes the clkin frequency and outputs a high-frequency source used to derive the general system frequency of the quicc. the pll is comprised of a phase detector, loop filter, voltage-controlled oscillator (vco), and multiplication block. the vco output can be as high as 50 mhz for a 25-mhz quicc. the pll? main functions are frequency multiplication and skew elimination. 6.5.3.1 frequency multiplication. the pll can multiply the clkin input frequency by any integer between 1 and 4096. the output of the vco is twice the quicc system fre- quency after reset. if a low frequency crystal is chosen (e.g., ~32 khz), the multiplier defaults to 401, giving a 2 vco output of ~26 mhz and an initial general system clock of ~13 mhz. the multiplica- tion factor may then be changed to the desired value by writing the mf11?f0 bits in the pllcr. when the pll multiplier is modified in software, the pll will lose lock, and the clocking to the quicc will stop until lock is regained (worst case is 2500 clocks; typical case is 500 clocks). see 6.5.4 low-power divider for methods of reducing clock rates without los- ing lock. extal crystal oscillator xtal xfc pin vccsyn xfc 390nf 0.01 f 0.1 f note: 1. must be low-leakage capacitor. see section 10 electrical characteristics for recommended values. 2. values are for 32 khz crystal and may vary due to capacitance on pcb. 2 0 pf 20 pf 20 m 330 k 1 clko1 clock generation clko2 vccclk gndcl k 0.1 f gndsyn vccsyn crystal 2
system integration module (sim60) motorola mc68360 user? manual 6-15 if the actual system clock is placed on the extal pin (rather than an external crystal), the multiplier defaults to 2, giving a 2 vco output of 2 the extal frequency. the multiplier bits should not be modified by the user in this case. see 6.5.4 low-power divider for meth- ods of reducing clock rates. note if the pll is used, the resulting 2 vco output should be a min- imum of 20 mhz, meaning that the minimum quicc system fre- quency should be 10 mhz (i.e., extal (mf + 1) >= 10 mhz.) use the clock divider control register (cdvcr) to divide the sys- tem clock by more than 1 if fully functional operation at less than 10 mhz is desired. 6.5.3.2 skew elimination. the pll is capable of eliminating the skew between the external clock entering the chip (extal) and the internal clock phases. the pll also elim- inates the skew between extal and the clko2?lko1 pins, providing advantages in generating low-skew clocking outputs. the skew is less than 2 ns. without the pll enabled, the clock skew could be much larger. this significant reduction of the clock skew is useful for synchronous clocking of multiple system components. for instance, a 25-mhz quicc may generate clocks for the mc68040?oth the 25-mhz bclk (extal) and the 50-mhz pclk (clko2) may be obtained from a single 25-mhz system clock input to the quicc. 6.5.4 low-power divider the output of the pll is sent to a low-power divider block. this block generates all other clocks in normal operation, but has the ability to divide the output frequency of the vco before it generates the syncclk, brgclk, and general system clock to the rest of the quicc. the purpose of the low-power divider block is to allow the user to reduce and restore the operating frequencies of different sections of the quicc without losing the pll lock. using the low-power divider block, the user can still obtain full chip operation, but at a slower fre- quency. this configuration is called slow-go mode. the selection and speed of the slow-go mode may be changed at any time, with changes occurring immediately. the low-power divider block is controlled in the cdvcr. the default state of the low-power divider is to divide all clocks by 1. thus, for a 25-mhz system, the syncclk, brgclk, and general system clock are each 25 mhz. if the low-power divider block is not used and the user is concerned that errant software could accidentally write the cdvcr, the user may set a write protection bit in cdvcr to pre- vent further writes to the register. 6.5.5 quicc internal clock signals the internal logic of the quicc uses five internal clock lines: general system clock, brg- clk, syncclk, simclk, and spclk. the quicc also generates two external clock lines
system integration module (sim60) 6-16 mc68360 user? manual motorola (clko1 and clko2). the pll synchronizes these clock signals to each other. these clock signals are discussed in the following paragraphs. 6.5.5.1 spclk. spclk is supplied to the pit and swt sub-modules in the sim60. spclk is always the extal frequency or extal/128, depending on the configuration of the divide- by-128 prescaler. when extal frequency > 10 mhz is selected by configuration pins (modck1-modck0 = 01), then the pll is clocked with the extal frequency and spclk is extal/128. (i1616.e. when modck is 11 --> spclk is equal to extal). 6.5.5.2 general system clock. this basic clock is supplied to all other modules and sub-modules on the quicc, including the cpu32+, the risc controller, and most other fea- tures in the communication processor module (cpm). the general system clock also sup- plies the simclk to the sim60 in normal device operation. the general system clock is the same as the clko1 frequency, and the clko2 signal is 2 the general system clock in nor- mal device operation. the general system clock defaults to vco/2 = 25 mhz (assuming a 25-mhz system frequency). the frequency of the general system clock can be changed dynamically with the cdvcr, as shown in figure 6-7. this configuration is called slow-go mode. figure 6-7. general system clock select the general system clock can be operated at three frequencies. normal operation is the highest frequency (25 mhz in a 25-mhz system). the general system clock can also be operated at a low frequency and a high frequency. the definition of low is made in the dfnl value in cdvcr; the definition of high is made in the dfnh value in cdvcr. the frequency of the general system clock can be changed dynamically by software. the user may simply cause the general system clock to switch to its low frequency. however, in some applications, there is a need for high frequency during certain periods. an example is in interrupt routines, etc., that need more performance than the low frequency operation, but must consume less power than in normal operation. the sim60 allows a method to auto- matically switch between low and high frequency operation. vco/2 (25 mhz) dfnh divider dfnl divider low power normal general system clock dfnh = 0 dfnh <> 00 notes: 1. normal = (csrc = 0) or (inten2?nten0 < interrupt) or (rrqen & risc not idle) 2. low power = normal
system integration module (sim60) motorola mc68360 user? manual 6-17 the general system clock can switch automatically from low to high frequency whenever one of the following conditions exists: the level of the pending or current interrupt is higher than the inten bits in cdvcr. the cpm risc controller has a pending request or is currently executing a routine (i.e., it is not idle). this option is maskable by the rrqen bit in cdvcr. when neither of these conditions exists, the general system clock automatically switches back to the low frequency. when the general system clock is divided, its duty cycle is changed. one phase remains the same (e.g., 20 ns @ 25 mhz); the other becomes longer. note that the clko1 and clko2 pins no longer have a 50% duty cycle when the general system clock is divided (see figure 6-8). figure 6-8. divided clocks 6.5.5.3 brgclk. the brgclk is used by the five cpm baud rate generators. there are four scc/scm baud rate generators and one spi baud rate generator. brgclk defaults to vco/2 = 25 mhz (assuming a 25-mhz system frequency). the purpose of brgclk is to allow the five baud rate generators to continue to operate at a fixed frequency, even when the rest of the quicc is operating at a reduced frequency (i.e., the general system clock is divided). see 7.9 baud rate generators (brgs) for more information on how to save power using the brgclk. notes during early board prototyping, the user should leave brgclk at its standard frequency (e.g., 25 mhz) for the sake of simplici- ty. within the four scc/smc baud rate generators, the user should not use a baud rate generator divider equal to 1, unless the brgclk is at the maximum frequency. 6.5.5.4 syncclk. the syncclk is used by the serial synchronization circuitry in the serial ports of the cpm, including the si, sccs, and smcs. the syncclk performs the function of synchronizing externally generated clocks before they are used internally. syncclk defaults to vco/2 = 25 mhz (assuming a 25-mhz system frequency). the purpose of syncclk is to allow the si, sccs, and smcs to continue to operate at a fixed frequency, even when the rest of the quicc is operating at a reduced frequency. thus, syncclk allows the user to maintain the serial synchronization circuitry at the desired rate, while lowering the general system clock to the lowest possible rate. however, the sync- clk frequency must always be at least as high as the general system clock frequency. divide by 1 divide by 2 divide by 4
system integration module (sim60) 6-18 mc68360 user? manual motorola the syncclk must always be at least 2 the desired serial clock rate, and at least 2.5 the desired serial clock rate if the time slot assigner (tsa) in the si is used. see 7.8 serial inter- face with time slot assigner for more information on how to select an appropriate frequency for the syncclk. note since syncclk does not clock very much logic on the quicc, syncclk is normally left at its full frequency (25 mhz). however, to temporarily lower the value of syncclk during an application to save more power, syncclk must remain at its highest fre- quency (e.g., 25 mhz) until the general system clock is reduced. only then can syncclk be lowered, and it must never be low- ered to a frequency less than the general system clock frequen- cy. 6.5.5.5 simclk. simclk is supplied to the sim60 module. simclk defaults to vco/2 = 25 mhz (assuming a 25-mhz system frequency). the simclk is the same as the general sys- tem clock when slow-go mode is programmed in the cdvcr, but can operate differently from the general system clock when the lpstop instruction is executed. the simclk is controlled in the pllcr. during the lpstop instruction, the pll can be left enabled or can be disabled to conserve power. this option is determined by the stsim bit in pllcr. if the pll is disabled, the sim- clk is either the extal/2 or the extal/128/2 frequency, depending on the divide-by-128 option. note the simclk is always the same frequency as clko1. 6.5.5.6 clko1. clko1 is the same as the general system clock frequency. clko1 defaults to vco/2 = 25 mhz (assuming a 25-mhz system frequency). clko1 can drive full strength, 2/3 strength, 1/3 strength, or be disabled. this option is controlled in the clkocr. disabling or decreasing the strength of clko1 can reduce power consumption, noise, and electromagnetic interference on the printed circuit board. during the lpstop instruction, the pll can be left enabled or can be disabled to conserve power. this option is determined by the stsim bit in pllcr. if the pll is disabled, clko1 is either the extal/2 or extal/128/2 frequency, depending on the divide-by-128 option. note clko1 is always the same frequency as the simclk. 6.5.5.7 clko2. clko2 is 2 general system clock frequency in normal operation. the clko2 vco normally equals 50 mhz (assuming a 25-mhz system frequency). clko2 can drive full strength, 2/3 strength, 1/3 strength, or be disabled. this option is controlled in the clkocr. disabling or decreasing the strength of clko2 can reduce power consumption, noise, and electromagnetic interference on the printed circuit board.
system integration module (sim60) motorola mc68360 user? manual 6-19 clko2 is always 2 clko1 except when the pll is acquiring lock. when the pll is acquir- ing lock, the clko2 signal is the extal or extal/128 frequency, as determined by the divide-by-128 option. for more information see 6.9.3.9 clko control register (clkocr). 6.5.6 pll power pins the following pins are dedicated to the pll operation. 6.5.6.1 vccsyn. this pin is the v cc dedicated to the analog pll circuits. the voltage should be well regulated, and the pin should be provided with an extremely low-impedance path to the v cc power rail. vccsyn should be bypassed to gndsyn by a 0.1- m f capacitor located as close as possible to the chip package. 6.5.6.2 gndsyn. this pin is the gnd dedicated to the analog pll circuits. the pin should be provided with an extremely low-impedance path to ground. gndsyn should be bypassed to vccsyn by a 0.1- m f capacitor located as close as possible to the chip pack- age. the user should also bypass gndsyn to vccsyn with a 0.01- m f capacitor as close as possible to the chip package. 6.5.6.3 xfc. this pin connects to the off-chip capacitor for the pll filter. one terminal of the capacitor is connected to xfc; the other terminal is connected to vccsyn. 6.5.7 clko power pins the following pins are dedicated to the clko operation. 6.5.7.1 vccclk. this pin is the v cc for the clko1 and clko2 output pins. the voltage should be well regulated and the pin should be provided with an extremely low-impedance path to the v cc power rail. vccclk should be bypassed to gndclk by a 0.1- m f capacitor located as close as possible to the chip package. 6.5.7.2 gndclk. this pin is the gnd for the clko1 and clko2 output pins. the pin should be provided with an extremely low-impedance path to ground. gndclk should be bypassed to vccclk by a 0.1- m f capacitor located as close as possible to the chip pack- age. 6.5.8 configuration pins (modck1?odck0) modck1?odck0 specifies whether the pll is enabled and what the initial vco fre- quency is after a hardware reset. during the assertion of reset , the value of the modck1 modck0 input pins causes the pllen bit and the mf bits of the pllcr to be appropriately written. modck1?odck0 also determines if the oscillator? prescaler is used. after reset is negated, the modck1?odck0 pins are ignored. table 6-1 lists the default val- ues of the pll. these pins have an internal pullup during a hardware reset.
system integration module (sim60) 6-20 mc68360 user? manual motorola note: if the pll is enabled and the multiplication factor is less than or equal to 4, then clko2?lko1 is synchronized to extal. 6.6 breakpoint logic the breakpoint logic provides an internal breakpoint address register (bkar) and a break- point control register (bkcr) that allow hardware breakpoints in a quicc system. this function is especially useful during in-field debugging activity when it is difficult to connect an in-circuit emulator or logic analyzer to the target board. the use of the background mode of the cpu32+, in combination with the breakpoint logic, provides a convenient and powerful debugging capability. note emulator manufacturers use the quicc breakpoint logic in their quicc emulator designs. customers using emulators should leave the breakpoint logic available for use by the emulator man- ufacturer, and should not configure the breakpoint logic in their application programs. when a breakpoint match occurs, the bkpt line is asserted. this can cause a bkpt excep- tion to the cpu32+, and will set a status bit in the idma or sdma that can be used to gen- erate a maskable interrupt. the maskable interrupt may or may not terminate idma or sdma activity, depending on the bus arbitration priority of the idma or sdma as compared to the interrupt level asserted. note when the quicc is configured for a 32-bit bus, the cpu32+ can fetch two instructions simultaneously. since there is only one bkpt pin, the user cannot break on each instruction, but rather must break on both, causing the bkpt exception to be taken af- ter the first instruction and before the second. the internal breakpoint logic, however, can assert a breakpoint for either in- struction individually. the breakpoint logic allows a great deal of flexibility in what constitutes a breakpoint match. if more than one hardware breakpoint is required, then additional breakpoints may be gen- erated externally in hardware and assert the bkpt pin. table 6-1. default operation mode of the pll modck 1? pll prescaled by 128 multi. factor (mf + 1) extal freq. (examples) clkin to the pll initial freq. (vco/2) 00 disabled reserved reserved reserved reserved reserved 01 enabled no 1 >10 mhz =extal =extal 10 enabled yes 401 4.192 mhz 32.75 khz 13.14 mhz 11 enabled no 401 32.768 khz 32.768 khz 13.14 mhz
system integration module (sim60) motorola mc68360 user? manual 6-21 32-bit address decode the bkar allows a full 32-bit address to be loaded. this address is qualified in various ways using the bkcr. if no address is desired, the v-bit in the bkcr may be cleared. address space checking the bkcr allows the user to check many combinations of function codes before causing a breakpoint match. nine bits in the bkcr allow such possibilities as excluding the idma and sdma function codes and the user and supervisor programs, but including user and supervisor data. read/write checking the breakpoint logic can cause a breakpoint match for read accesses only, write access- es only, or both read and write accesses. 8, 16, 24 and 32 bit sizes the breakpoint logic can cause a breakpoint match for accesses to the specified address with a size of byte, word, three byte, long word, or any size. variable block sizes if desired, the breakpoint match can occur in a region larger than just one address. block sizes may be defined to be the block of memory in which the address resides. the blocks sizes may be 2k, 8k, or 32k bytes. additionally, the breakpoint match can be defined to occur at every address except the address or address block that is specified. this feature allows the user to single step all his program code. the breakpoint logic is then used to mask off the user? monitor/debug- ger. the monitor/debugger thus resides within the programmable block specified by the breakpoint logic. external masters the breakpoint logic can also work with external masters, such as an external mc68040, mc68030, or quicc. the bkpt pin is asserted when a match is detected. in the case of an external mc68040, the user may have to set the tss40 bit in the gmr to allow enough setup time for the address comparison logic. also, in the case of an ex- ternal mc68040, the comparison is only made on the first accesses of an mc68040 burst access (i.e., the address comparison of the breakpoint logic is performed only when the mc68040 ts pin is asserted). 6.7 external bus interface control this subsection describes the method by which the ebi is configured, which includes the data bus size (either 32 or 16 bits), port d, and port e. refer to section 4 bus operation for more information about the ebi.
system integration module (sim60) 6-22 mc68360 user? manual motorola note all accesses to the quicc internal ram and registers (including mbar) by an external master are asynchronous to the quicc clock. read and write accesses are with three wait states, and dsack is asserted by the quicc assuming three-wait-state ac- cesses. 6.7.1 initial configuration the quicc has three configuration (config) pins that are sampled during system (or power-up) reset to select the initial size of the global chip select and whether the quicc is in the normal (cpu32+ enabled) mode or the slave (cpu32+ disabled) mode (see table 6- 2). see 6.10 memory controller for a description of the global chip select and 6.8 slave (disable cpu32+) mode for a description of slave mode. in normal mode, the global chip select can initially assume the boot rom port size to be either 8, 16, or 32 bits. in the slave mode, the global chip select can be enabled with 8, 16, or 32 bits, or the global chip select can be dis- abled. the global chip select would normally be disabled if another quicc or processor was providing the boot rom chip select function. 6.7.2 port d if the user configures a 16-bit data bus by driving a zero voltage on the prty3 pin during system reset, then the d0?15 pins are not used as a data bus, but are referred to as port d. at this time, port d is not available for general-purpose i/o or any other alternate function on the quicc. in the future, these pins may be defined to have an additional function in 16- bit data bus mode. table 6-2. quicc initial configuration configuration pins result config2 /freeze config1 /bclro config0 /rmc 0 0 0 slave mode; global chip select 8-bit size; mbar at $003ff00. 001 slave mode; global chip select 32-bit size; mbar at $003ff00; not mc68040 companion mode; br output, bg input. 0 1 0 slave mode; global chip select 16-bit size; mbar at $003ff00. 011 mc68040 companion mode; global chip select 32-bit size; mbar at $003ff00; br input, bg output. 1 0 0 cpu32+ enabled; global chip select 32-bit size; mbar at $003ff00. 1 0 1 cpu32+ enabled; global chip select 16-bit size; mbar at $003ff00. 1 1 0 slave mode; global chip select disabled; mbar at $003ff04. 1 1 1 cpu32+ enabled; global chip select 8-bit size; mbar at $003ff00.
system integration module (sim60) motorola mc68360 user? manual 6-23 notes the 16-bit data bus is available on the d16?31 pins. dynamic bus sizing for 8- and 16-bit ports is possible with a 16-bit data bus. prty3 has a small internal pullup to pull a floating prty3 signal high. thus, the default condition of the quicc provides a full 32- bit data bus, with 8-, 16-, and 32-bit dynamic bus sizing possible. 6.7.3 port e port e pins can be independently programmed to select a number of system bus signal alter- natives, including cas lines, we lines, oe lines, iack lines, etc. the port e pin assignment register controls the function of the port e pins. see 6.9.4 port e pin assignment register (pepar). 6.8 slave (disable cpu32+) mode in this mode, the cpu32+ core on the quicc is disabled, and the quicc functions as an intelligent peripheral. slave mode is enabled during system (or power-up) reset by the con- figuration of the config pins. in slave mode, the idmas and sdmas on a quicc can still obtain ownership of the system bus, even through the cpu32+ core is disabled. the slave mode has several common uses: 1. a multiple quicc system. one quicc in the system works normally with its cpu32+ enabled. it is called the system master. the rest of the quiccs are used in slave mode as peripherals, with their cpus disabled. the slaves would have their config pins configured to 110. 2. mc68040 companion mode. the quicc operates solely as a peripheral to the mc68ec040 processor (or other m68040 family member). in this case, the quicc provides a two-chip mc68ec040 system solution. one benefit of this configuration is that the quicc memory controller can provide dram control for the mc68ec040 that includes mc68ec040 bursting support. in an mc68ec040+quicc system, the quicc? config pins would normally be set to 011 for a 32-bit boot rom. 3. mc68040 companion mode with multiple quiccs. in this case, multiple quiccs can be slaves to a single mc68ec040. the user then chooses one of the quiccs to pro- vide the dram control for the mc68ec040 as well as the other quiccs. in this case, the mc68ec040 access to the dram is not slowed down by the relatively slower quicc accesses. the first quicc in the system would have its config pins set to 011, and the other quiccs added to that system would have their config pins set to 110. 4. quicc is a slave to the mc68030. the quicc operates as a peripheral to the mc68ec030 processor (or other mc68030 family member). the quicc's standard slave mode is used since its bus is an mc68030-type bus. the quicc does not sup- port mc68030 burst accesses. in an mc68ec030+quicc system, the quicc's config pins could be set to 000, 001, or 010, depending on the boot rom size.
system integration module (sim60) 6-24 mc68360 user? manual motorola notes when used in slave mode, the quicc must be configured with a 32-bit data bus. even without the use of the slave mode, another processor can be granted access to the quicc's on-chip peripherals by re- questing the bus with the br pin. 6.8.1 mbar in a multiple quicc system the module base address register (mbar) is used to configure the location of the quicc's block of on-chip ram and registers. in a multiple quicc system, a technique must be pro- vided to allow multiple mbars on multiple quiccs to be programmed with unique values. the quicc has several provisions to support this. first, any quicc that is configured into slave mode with its global chip select disabled (config pins = 110) automatically has its mbar location changed from $0003ff00 to $0003ff04. second, the mbar, newly located at address $0003ff04, can only be enabled for access after a keyed write operation is performed (see figure 6-9). the keyed write allows the user to program the mbars of multiple quicc slaves without adding any exter- nal glue logic. notes if the quicc is configured into slave mode with its global chip select enabled, the mbar location does not change, and the keyed write is not required. thus, a single quicc configured as a slave to an mc68ec040 or mc68ec030 does not require a keyed write for its mbar. if there are n quiccs sharing a bus, n? quiccs would nor- mally have their config pins configured as 110. figure 6-9. mbar access to a multiple quicc slave system 4 kb 4 kb mbar $0003ff04; fc = 111 mbar select bit (bit 31) $0003ff08; fc = 111 mbare mbare pin dual-port ram internal registers
system integration module (sim60) motorola mc68360 user? manual 6-25 the keyed write uses the mbar enable (mbare) register at address $0003ff08 and the mbare pin. both the newly located mbar and the mbare are located in the cpu address space fc = 111. with multiple quiccs configured in slave mode, the following keyed write is used to enable the mbar programming: the user writes the mbar select bit of mbare with a 1 while the mbare pin is a logic zero. once this is accomplished, the mbar may be written at its new location (using the standard mbar writing techniques). once mbar is written (in particular, the low-order byte of mbar), then the mbar select bit in mbare is cleared, and further accesses to mbar are impossible until the keyed write technique is used again. there is no time limit imposed between the keyed write and the mbar write; however, once the keyed write for a particular quicc slave has occurred, the mbar of that slave should be written before performing another keyed write to another quicc slave. the keyed write may be performed gluelessly to multiple quicc slaves in the following way. connect (in hardware) the mbare pin of quicc slave #1 to bit zero of the data bus(d0). connect the mbare pin of quicc slave #2 to d1, etc. then perform the following opera- tions in software: 1. write the mbare of quicc slave #1 at $0003ff08 with value $fffffffe. this sets the mbar select bit (bit 31) and places a low voltage on only the mbare pin of quicc slave #1. 2. now the mbar of quicc slave #1 can be accessed at $0003ff04 and written using normal mbar writing procedures. 3. write the mbare of quicc slave #2 with the value $fffffffd. 4. now the mbar of quicc slave #2 can be written. this technique will work for up to 31 quicc slaves in the system, using no glue or parallel i/o pins. 6.8.2 global chip select (cs0 ) in slave mode when the quicc is in slave mode, the user may choose whether to enable the global chip- select operation of cs0 . (the global chip select is used for boot roms and is described in 6.10 memory controller.) the global chip select can be either enabled or disabled by the configuration on the config pins during power-up reset and system reset (reset h asserted). when the global chip select function is disabled, cs0 can still be enabled later and used as a normal chip select, if desired. 6.8.3 bus clear in slave mode the bus clear out (bclro ) pin can be selected to signify to the external logic that the dram refresh controller, idma channels, or sdma channels are requesting the bus. however, in slave mode, the bclro pin may become the ras2dd double drive pin, and a new pin called bus clear in (bclri ) is defined (at another location in the pinout). bclri indicates to that quicc that a request is being made for the quicc to release the system bus. the ebi will then clear all internal bus masters with an arbitration id smaller than the programmed value of the bus clear in id (bclriid) in the mcr.
system integration module (sim60) 6-26 mc68360 user? manual motorola 6.8.4 interrupts in slave mode the sim60 interrupt controller continues to function in slave mode and can present inter- rupts from the pit, swt, and external interrupt sources on the irqx pins to the processor. the highest priority request is output as an encoded value on the ioutx pins or is output on a single rqout pin. the cpm will also generate interrupts in slave mode. the cpm always generates unique vectors for its sub-modules in slave mode. the cpm also offers a number of individual inter- rupt request inputs (port c pins) that may be used in slave mode. when the sim60 is in slave mode, the pit and swt must also generate interrupt vectors. for the irqx pins, no vector is output in slave mode; rather, the aveco pin is asserted if the corresponding bit in the avr is set. one important restriction must be adhered to in slave mode. the user should not utilize an irqx pin that is on the same level as the cpm, pit, or swt. the level of the cpm is pro- grammed in the cicr. the level of the pit is programmed in the picr. the level of the swt is 7 if it generates interrupts. note that cpm port c pins operate similarly to the irqx pins and may still be used. 6.8.5 pin differences in slave mode a number of signals change functionality in slave mode. see section 2 signal descriptions for a full listing. a partial list of functionality changes is as follows: 1. br will be an output from the quicc (refresh cycles, idma, and sdma) to the external bus. note br is still an input in mc68040 companion mode. 2. bg will be an input to the quicc (refresh cycles, idma, and sdma) from the external bus. note bg is still an output in mc68040 companion mode. 3. bgack will be asserted during the quicc external bus cycles. 4. the quicc interrupt controller will output its interrupt requests on the iout2 iout0 pins, which normally would be sent to the cpu32+ core, and will reflect internally the interrupt acknowledge cycle. the three ioutx pins reflect the seven interrupt request levels. the ioutx pins can be output on the irq1 , irq4 , and irq6 pins or on the par- ity prty2?rty0 pins as programmed in the port e pin assignment register. addi- tionally, the quicc interrupt controller can output its interrupt requests on one interrupt request pin (rqout ) instead of three pins. 5. an avec output (aveco ) function is supported instead of the avec input pin. 6. the breakpoint logic may monitor the external bus instead of the internal bus and as- sert the bkpto pin. 7. the three-state (tris ) pin becomes the transfer start (ts ) pin in slave mode. anytime
system integration module (sim60) motorola mc68360 user? manual 6-27 the quicc is in slave mode, assertion of the ts pin notifies the quicc that an exter- nal mc68040 cycle is beginning. although the user typically configures the configx pins for mc68040 companion mode, this configuration is not required. it is possible for the quicc to recognize an mc68040 cycle in any of the slave mode variations. (the reason for the mc68040 companion mode configuration of the configx pins is to al- low the bus arbitration pins to have their directions reversed while still in slave mode.) 6.8.6 other functionality in slave mode although the slave mode does enable a number of different pins on the system bus and causes functional activities such as bus arbitration and interrupt handling to occur differ- ently, if a feature is not cited as changing its behavior in slave mode (i.e., 98% of the features on quicc), then it is not impacted by slave mode and continues to operate normally. 6.9 programmer? model the sim60 contains a number of registers, described in the following paragraphs. their locations and initial values may be found in section 3 quicc memory map. 6.9.1 module base address register (mbar) the mbar is a 32-bit, memory-mapped, read-write register consisting of the high address bits. upon a total system reset, its value may be read as $0. the address of this register is fixed at $03ff00 in cpu space (except in slave mode where it is located at $03ff04). see 6.8 slave (disable cpu32+) mode for details. cpu space only ba31?a13?ase address the base address field is the upper 19 bits of the mbar, providing for block starting loca- tions in increments of 8 kbytes. as8?s0?ddress space the address space field allows particular address spaces to be masked, placing the 8k module block into a particular address space(s). if an address space is masked, an ac- cess to the register block location in that address space becomes an external access. the module block is not accessed. the address space bits for non-040 type master are: 1. as8?ask dma space address space (fc3?c0=1xxx) 2. as7?ask cpu space address space (fc3?c0=0111) 3. as6?ask supervisor program address space (fc3?c0=0110) 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 ba31 ba30 ba29 ba28 ba27 ba26 ba25 ba24 ba23 ba22 ba21 ba20 ba19 ba18 ba17 ba16 reset: 0 000000 000000000 1514131211109876543210 ba15 ba14 ba13 0 0 0 as8 as7 as6 as5 as4 as3 as2 as1 as0 v reset: 0 000000 000000000
system integration module (sim60) 6-28 mc68360 user? manual motorola 4. as5?ask supervisor data address space (fc3?c0=0101) 5. as4?ask motorola reserved address space (fc3?c0=0100) 6. as3?ask user reserved address space (fc3?c0=0011) 7. as2?ask user program address space (fc3?c0=0010) 8. as1?ask user data address space (fc3?c0=0001) 9. as0?ask motorola reserved address space (fc3?c0=0000) the address space bits for 040 type mpu are: 1. as8?o relevance for 040 cycles 2. as7?cknowledge access (tt1-tt0=11) 3. as6?upervisor code access (tt1-tt0=00, tm2-tm0=110) 4. as5?upervisor data access (tt1-tt0=00, tm2-tm0=101) 5. as4?mu table search code access (tt1-tt0=00, tm2-tm0=100) 6. as3?mu table search data access (tt1-tt0=00, tm2-tm0=011) 7. as2?ser code access (tt1-tt0=00, tm2-tm0=010) 8. as1?ser data access (tt1-tt0=00, tm2-tm0=001) 9. as0?ata cache push access (tt1-tt0=00, tm2-tm0=000) note the user should mask off as7, as4, as3 and as1 to prevent unwanted access to the quicc internal dual port ram (dpr). for example, as7 should be masked out so that the iack cycle will not cause an access to the dpr. for each address space bit: 1 = mask this address space from the internal module selection. the bus cycle goes external. 0 = decode for the internal module block. v?alid this bit indicates when the contents of the mbar are valid. the base address value is not used; therefore, all internal module registers are not accessible until the v-bit is set. 0 = contents not valid. 1 = contents valid. note when working in the cpu enable mode, an access to this regis- ter does not affect external space since the cycle is not run ex- ternally. mbar can be read using the following code. register d0 will contain the value of mbar.
system integration module (sim60) motorola mc68360 user? manual 6-29 move #7,d0 load d0 with the cpu space function code movec d0,sfc load sfc to indicate cpu space movec d0,dfc load dfc to indicate cpu space lea $3ff00,a0 load a0 with the address of mbar moves.l (a0),d0 load d0 with the contents of mbar mbar can be written to using the following code. address $0003ff00 in cpu space (mbar) will be loaded with the value $ffff f001. this will set the base address of the inter- nal registers to $fffff. move #7,d0 load d0 with the cpu space function code movec d0,sfc load sfc to indicate cpu space movec d0,dfc load dfc to indicate cpu space lea $3ff00,a0 load a0 with the address of mbar move.l #$fffff001,d0 load d0 with the value to be written into mbar moves.l d0,(a0) write the value contained in d0 into mbar 6.9.2 module base address register enable (mbare) the mbare is a 32-bit, memory-mapped, read-write register. upon a total system reset, its value may be read as $0. the address of this register is fixed at $03ff08 in cpu space. it is used to enable the mbar to be programmed when multiple quiccs are in slave mode. (see 6.8.1 mbar in a multiple quicc system for details.) cpu space only mbs?bar select 0 = no operation. 1 = the mbar is now ready to be programmed on this slave quicc device if the mbare pin was low during the write to this bit. 6.9.3 system configuration and protection registers the following paragraphs provide descriptions of the system configuration and protection registers. 6.9.3.1 module configuration register (mcr). the mcr, which controls the sim60 configuration, can be read or written at any time. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 mbs reset: 0 000000 000000000 1514131211109876543210 reset: 0 000000 000000000
system integration module (sim60) 6-30 mc68360 user? manual motorola br040id2?r040id0?us request mc68040 arbitration id these bits contain the arbitration priority level for the mc68040 br signal when the quicc is in mc68040 companion mode; otherwise, this value is ignored. the mc68040 br signal in companion mode) is reflected on the imb with the bus arbitration level corre- sponding to these bits. this method gives the user a choice of where to place the arbitra- tion level of the mc68040 (and other external masters in this system) relative to the idma, sdma, or dram refresh cycles generated by the qiucc. note in a typical configuration, the user would program this value to a 3 to give the mc68040 priority over the idmas, but not over the sdmas and the dram refresh cycle. if the sdmas, however, are not of extremely high priority, the user may choose this value to be 5. user should never program this field to be 7. bits 28?7?eserved bstm?us synchronous timing mode this bit determines whether the ebi will synchronize the as and ds bus signals used for an external master? access into the quicc peripherals and for cs and ras generation by the quicc. the synchronization will add a one-clock delay to the ras /cs assertion for an external master. the mc68ec040 signals must always be synchronized to the quicc clock, regardless of the setting of this bit. see 6.10 memory controller for recom- mendations on the setting of bstm in certain situations. 0 = asynchronous timing on the bus signals may be used. the bus signals are syn- chronized internally by the quicc and do not have to meet any timings relative to the system clock. 1 = synchronous timing on the bus signals must be used. the bus control signals will not be synchronized internally and therefore must meet the system clock setup and hold timings. note bclri , address, data, dsack , berr , halt , reseth , and resets are always asynchronous. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 br040id2?r040id0 bstm 0000000000000000 1514131211109876543210 astm frz1?rz0 bclroid2?clroid0 shen1?hen0 supv bclrism2?clrism0 or bclriid2?clriid0 iarb3?arb0 0111110011111111
system integration module (sim60) motorola mc68360 user? manual 6-31 astm?rbitration synchronous timing mode this bit determines whether the ebi will synchronize the arbitration signals: br , bg , and bgack . the synchronization will add a one-clock delay to the external bus arbitration. 0 = asynchronous timing on the arbitration signals may be used. the arbitration sig- nals will be synchronized internally by the quicc and do not have to meet any tim- ings relative to the system clock. 1 = synchronous timing on the arbitration signals must be used. the arbitration control signals will not be synchronized internally and therefore must meet the system clock setup and hold timings. frz1?reeze swt and pit enable 0 = when freeze is asserted, the swt and the pit counters continue to run. see 6.3.3 freeze support for more information. 1 = when freeze is asserted, the swt and the pit counters are disabled, prevent- ing interrupts from occurring during software debugging. frz0?reeze bus monitor enable 0 = when freeze is asserted, the bus monitor continues to operate as programmed. 1 = when freeze is asserted, both the internal and external bus monitors are dis- abled. bclroid2?clroid0?us clear out arbitration id these bits contain the arbitration priority level for the assertion of the bclro signal. when internal masters (idma, sdma, or dram refresh cycle) request the bus and the arbitration level on the imb is greater than the bus clear out arbitration id, the bclro sig- nal will be asserted until the arbitration level is less than or equal to the bus clear out ar- bitration id. bclro can be used to clear an external master from the external bus when a refresh cycle is pending. it may also be used to clear an external master from the bus when an sdma or idma channel requests the external bus. note program this value to 3 in a normal system to allow the sdma and dram refresh controller to clear other bus masters off the external bus. shen1?hen0?how cycle enable these two control bits determine what the ebi does with the external bus during internal transfer operations (see table 6-3). a show cycle allows internal transfers to be externally monitored. the address, data, and control signals (except for as ) are driven externally. ds is used to signal address strobe timing for show cycles. data is valid on the next falling clock edge after ds is negated. however, data is not driven externally and as and ds are not asserted externally for internal accesses unless show cycles are enabled. if external bus arbitration is disabled, the ebi will not recognize an external bus request until arbitration is enabled again. when shen1 is set, an external bus request causes an internal master to stop its current cycle and relinquish the internal bus. the internal master resumes running cycles on the bus after br and bgack are negated. to prevent bus
system integration module (sim60) 6-32 mc68360 user? manual motorola conflicts, external peripherals must not attempt to initiate cycles during show cycles with arbitration disabled. note during normal operation, berr and dsackx for internal cycles will not appear as an external cycle in master mode. for fast termination cycles, dsackx is never asserted external- ly regardless of the show cycle bit settings. in slave mode, these bits default to 00, and writes by the user have no effect on operation. in case 00 (show cycles disabled), if the external bus is available when an internal-to-internal access occurs, the address and function code pins will reflect the internal access. case 01 may be used as a debugging aid to eliminate the exter- nal bus master as a possible cause of the problem or to prevent interference in a user debug session. although case 00 is recommended for normal operation, case 1x may be used during initial development for visibility on the inter- nal bus, at the expense of performance. moving from 1x to 00 in- creases performance for two reasons: 1) both the internal and external buses may be used simultaneously and 2) the external bus master will obtain the bg signal assertion more quickly after asserting br . supv?upervisor/user data space the supv bit defines the sim60 global registers as either supervisor data space or user (unrestricted) data space. it is a don? care on the sim60 and is reserved for future expan- sion. 0 = the sim60 registers defined as supervisor/user data are unrestricted (fc2 is a don? care). 1 = the sim60 registers defined as supervisor/user are restricted to supervisor data access (fc3?c0 = $5). any attempted user space write is ignored and returns berr. table 6-3. show cycle control bits shen1 shen0 action 00 normal operation. split buses mode. show cycles is disabled and external arbitration is enabled. 0 1 show cycles enabled. external arbitration is disabled and bg is never asserted. 1x show cycles enabled. external arbitration is enabled and internal activity is halted when bg is asserted by the quicc.
system integration module (sim60) motorola mc68360 user? manual 6-33 note this bit is ?on? care?in the sim60 since no user space registers exist. it is reserved for future expansions. bclrism2?clrism0?us clear interrupt service mask (normal mode only) these bits contain the interrupt service mask. when the interrupt service level on the imb is greater than the interrupt service mask, the bclro signal will be asserted until the in- terrupt level is less than or equal to the interrupt service mask. this feature can be used to clear an external master from the external bus to reduce the interrupt latency for a cer- tain interrupt level and above. notes this value should be programmed to 7 in a typical system unless the user needs to give certain interrupt routines priority over ex- ternal bus masters. in slave mode (disable cpu32+), these bits are not used and have a different definition. bclriid2?clriid0?us clear in arbitration id (slave mode only) these bits contain the arbitration priority level for the bclri signal. if bclri is asserted when the internal master (idma, sdma, or dram refresh cycle) is requesting or using the bus, and if the arbitration level on the imb is lower than the bus clear in arbitration id bits, the internal master will release the bus until the bclri signal is negated. thus, bcl- ri can be used to clear an internal master from the external bus when the bus is needed for a higher priority task. notes program the arbitration ids of the quicc as follows: sdma = 4, idmax = 2, idmay = 0. the dram refresh controller is always 6. thus, the user may choose 3 for this value to give the external master priority over the idma channels only. in the case of the mc68040 companion mode, the bg pin is also negated by the quicc when an internal master has released the bus. in normal operation (cpu32+ enabled), these bits are not used and have a different definition. this field should never be programmed to be 7. iarb3?arb0?nterrupt arbitration the reset value of iarb is $f, allowing the sim60 to win interrupt arbitrations during an interrupt acknowledge cycle immediately after reset. the system software should initialize the iarb field to a value from $f (highest priority) to $1 (lowest priority).
system integration module (sim60) 6-34 mc68360 user? manual motorola note if, a sim60 interrupt source shares a level with the cpm, write either $f or $1 to this register. since the cpm interrupt arbitra- tion id is always 8, the $f gives the sim60 source higher priority than the cpm source(s), and a $1 gives the interrupt source low- er priority than the cpm source(s). this field should never be programed to 0. 6.9.3.2 autovector register (avr). the avr contains bits that correspond to exter- nal interrupt levels that require an autovector response. setting a bit allows the sim60 to assert an internal avec during the interrupt acknowledge cycle in response to the specified interrupt request level. this register can be read and written at any time. supervisor only note the iarb field in the mcr must contain a value other than $0 for the sim60 to produce an autovector for external interrupts. 6.9.3.3 reset status register (rsr). the rsr contains a bit for each reset source to the sim60. a set bit indicates the last type of reset that occurred. the rsr is updated by the reset control logic when the reset is complete. after power-up reset, the pow bit and the ext bit are set. other bits may be set after different kinds of reset occur. since this reg- ister is only cleared upon a power-up reset, the user should clear this register after every reset so that the cause of the most recent reset may be easily determined. a bit is cleared by writing a one (writing a zero does not affect a bit? value). more than one bit may be cleared at a time. the register may be read at any time. for more information, see section 4 bus operation. supervisor only ext?xternal total system reset (hard reset) 1 = the last reset was caused by an external signal driving reseth . this will reset all the quicc's peripherals to the state they had at power-up reset. this reset, which is also referred to as system reset or hardware reset, has the same effect in the system as a power-up reset. pow?ower-up reset 1 = the last reset was caused by the power-up reset circuit. 7 6543210 av7 av6 av5 av4 av3 av2 av1 - reset: 0 0000000 7654321 0 ext pow sw dbf loc srst srstp
system integration module (sim60) motorola mc68360 user? manual 6-35 sw?oftware watchdog reset 1 = the last reset was caused by the software watchdog circuit. dbf?ouble bus fault monitor reset 1 = the last reset was caused by the double bus fault monitor. bit 3?eserved loc?oss of clock reset 1 = the last reset was caused by a loss of frequency reference to the clock sub-mod- ule. this reset can only occur if the rsten bit in the clock sub-module is set and the vco is enabled. srst?oft reset 1 = the last reset was caused by the cpu32+ executing a reset instruction. the re- set instruction does not load a reset vector or affect any internal cpu32+ regis- ters or sim60 configuration registers, but does reset external devices and other internal modules. see section 3 quicc memory map for a listing of registers af- fected by the hard reset. this bit is not valid in cpu disable mode. srstp?oft reset pin 1 = the last reset was caused by an external signal driving resets . see section 3 quicc memory map for a listing of registers affected by the soft reset. 6.9.3.4 software watchdog interrupt vector register (swiv). the swiv contains the 8-bit vector that is returned by the sim60 during an interrupt acknowledge cycle in response to an interrupt generated by the swt. this register can be read or written at any time. this register is set to the uninitialized vector, $0f, at reset. supervisor only 6.9.3.5 system protection control register (sypcr). the sypcr controls the system monitors, the prescaler for the swt, and the bus monitor timing. this register can be read at any time, but can be written only once after system reset. supervisor only 7 6543210 swiv7 swiv6 swiv5 swiv4 swiv3 swiv2 swiv1 swiv0 reset: 0 0001111 7 6543210 swe swri swt1 swt0 dbfe bme bmt1 bmt0 reset: 11 modck 1 modck 10000
system integration module (sim60) 6-36 mc68360 user? manual motorola swe?oftware watchdog enable this bit should be cleared by software after a system reset to disable the swt. see 6.3.1.2.4 software watchdog timer (swt) for more information. 0 = swt is disabled. 1 = swt is enabled. (this is the default value after system reset.) swri?oftware watchdog reset/interrupt select 0 = swt causes a level 7 interrupt to the cpu32+. 1 = swt causes a system reset. (this is the default value after system reset.) note for more information on reset see 4.7 reset operation. swt1?wt0?oftware watchdog timing these bits, along with the swp bit in the pitr, control the divide ratio used to establish the timeout period for the swt. the default value (11) yields the maximum timeout period. the swt timeout period is given by the following formula: or the swt timeout period listed in table 6-4 gives the formula to derive the swt timeout for any clock frequency. the timeout periods are listed for various input frequencies. note that the input frequency to the swt is called extaldiv in the formulas and is the extal fre- quency divided by 1 or by 128, depending on the modck1?odck0 pins. notes: 1. note that a 4.192-mhz oscillator produces the same 32.768 input frequency (the 4.192 mhz is divided by 128 in the oscillator circuit). 2. programming for this timeout period must be done after the programming of the pll. see also 6.9.3.10 pll control register (pllcr) . 1 (extaldiv)/(divide count) divide count extaldiv table 6-4. deriving swt timeout swp swt1?wt0 software timeout period 32.768 khz 1 16.677 mhz 25 mhz 33.354 mhz 000 2 9 /input frequency 2 15.6 ms 3.9 ms 2.6 ms 1.9 ms 001 2 11 /input frequency 62.5 ms 15.7 ms 10.5 ms 7.9 ms 010 2 13 /input frequency 250 ms 62.9 ms 41.9 ms 31.4 ms 011 2 15 /input frequency 1 s 251.5 ms 167.7 ms 125.7 ms 100 2 18 /input frequency 8 s 2.0 s 1.3 s 1.0 s 101 2 20 /input frequency 32 s 8.0 s 5.4 s 4.0 s 110 2 22 /input frequency 128 s 32.2 s 21.5 s 16.1 s 111 2 24 /input frequency 512 s 128.8 s 85.9 s 64.4 s
system integration module (sim60) motorola mc68360 user? manual 6-37 note when the swp and swt bits are modified to select a software timeout other than the default, the software service sequence ($55 followed by $aa written to the software service register) must be performed before the new timeout period takes effect. dbfe?ouble bus fault monitor enable 1 = enable the double bus fault monitor function. (default) 0 = disable the double bus fault monitor function. for more information, see 6.3.1.2.3 double bus fault monitor and section 5 cpu32+. bme?us monitor external enable 0 = enable bus monitor function for the external bus cycles. 1 = disable bus monitor function for the external bus cycles. (default) for more information see 6.3.1.2.1 bus monitor. bmt1?mt0?us monitor timing these bits select the timeout period for the bus monitor (see table 6-5). 6.9.3.6 periodic interrupt control register (picr). the picr contains the interrupt level and the vector number for the periodic interrupt request. this register can be read or written at any time. bits 15?1 are unimplemented and always return zero; a write to these bits has no effect. supervisor only pirql2?irql0?eriodic interrupt request level these bits contain the periodic interrupt request level. table 6-6 lists which interrupt re- quest level is asserted during an interrupt acknowledge cycle when a periodic interrupt is generated. the pit continues to run when the interrupt is disabled. note use caution with a level 7 interrupt encoding due to the sim60 interrupt servicing order. see 6.3.1.2 simultaneous sim60 inter- rupt sources for the servicing order. table 6-5. bmt encoding bmt1 bmt0 bus monitor timeout period 0 0 1k system clocks (clko1 clocks) 0 1 512 system clocks 1 0 256 system clocks 1 1 128 system clocks 1514131211109876543210 0 0000 pirql2 pirql1 pirql0 piv7 piv6 piv5 piv4 piv3 piv2 piv1 piv0 reset: 0 000000000001111
system integration module (sim60) 6-38 mc68360 user? manual motorola piv7?iv0?eriodic interrupt vector these bits contain the value of the vector generated during an interrupt acknowledge cy- cle in response to an interrupt from the pit. when the sim60 responds to the interrupt acknowledge cycle, the periodic interrupt vector from the picr is placed on the bus. this vector number is multiplied by 4 to form the vector offset, which is added to the vbr in the cpu32+ to obtain the address of the vector. 6.9.3.7 periodic interrupt timer register (pitr). the pitr contains control for prescaling the swt and pit as well as the count value for the pit. this register can be read or written at any time. bits 15?0 are not implemented and always return zero when read. a write does not affect these bits. supervisor only swp?oftware watchdog prescaler control this bit controls the swt clock source as shown in 6.9.3.5 system protection control register (sypcr). the swp reset value is the inverse of the modck1 pin state on the rising edge of reset. 0 = swt clock is not prescaled. 1 = swt clock is prescaled by a value of 512. ptp?eriodic timer prescaler control this bit contains the prescaler control for the pit. the ptp reset value is the inverse of the modck1 pin state on the rising edge of reset. 0 = pit clock is not prescaled. 1 = pit clock is prescaled by a value of 512. pitr7?itr0?eriodic interrupt timer register these bits contain the remaining bits of the pitr count value for the pit. a zero value turns off the pit. these bits may be written at any time to modify the pit count value. table 6-6. periodic interrupt request level encoding pirql2 pirql1 pirql0 interrupt request level 0 0 0 pit disabled 0 0 1 interrupt request level 1 0 1 0 interrupt request level 2 0 1 1 interrupt request level 3 1 0 0 interrupt request level 4 1 0 1 interrupt request level 5 1 1 0 interrupt request level 6 1 1 1 interrupt request level 7 1514131211109876543210 0 00000swpptp pitr7 pitr6 pitr5 pitr4 pitr3 pitr2 pitr1 pitr0 reset: 0 00000 modck 1 modck 1 00000000
system integration module (sim60) motorola mc68360 user? manual 6-39 note if the pit is enabled with the ptp bit set, then the first interrupt can be up to 512 clocks early. 6.9.3.8 software service register (swsr). the swsr is the location to which the swt servicing sequence is written. to prevent an swt timeout, the user should write a $55 followed by a $aa to this register. the swt can be disabled by clearing the swe bit in the sypcr. the swsr can be written at any time, but returns all zeros when read. supervisor only 6.9.3.9 clko control register (clkocr). the clkocr controls the operation of the clko2-1 pins. clkowp bit in clkocr is used as a protect mechanism to prevent erroneous writing. clkocr can be read or written only in supervisor mode. clkowp?lkocr write protect this bit protects accidental writing into the clkocr. after reset, this bit defaults to zero to enable writing. setting this bit prevents further writing (excluding the first write that sets this bit). bits 6 -4?eserved com2?lock output 2 mode the com2 bits control the output buffer strength of the clko2 pin. when both bits are set, the clko2 pin is held in the high (1) state. these bits can be dynamically changed without generating spikes on the clko2 pin. if the clko2 pin is not connected to external circuits, set both bits (disabling the clock output) to minimize noise and power dissipation. the com2 bits are set to ones at system reset, unless modck = 01, in which case they are cleared. this causes clko2 to be disabled at system reset, unless modck = 01. (this causes clko2 to default to a quiet state, unless it is needed in an mc68040 com- panion mode system.) 00 = clock out enabled, full-strength output buffer 01 = clock out enabled, 2/3-strength output buffer 10 = clock out enabled, 1/3-strength output buffer 11 = clock out disabled (driving 1) com1?lock output 1 mode the com1 bits control the output buffer strength of the clko1 pin. when both bits are set, the clko1 pin is held in the high (1) state. these bits can be dynamically changed 76543210 swsr7 swsr6 swsr5 swsr4 swsr3 swsr2 swsr1 swsr0 76543210 clkowp com2 com1 reset: 00000/10/10/10/1
system integration module (sim60) 6-40 mc68360 user? manual motorola without generating spikes on the clko1 pin. if the clko1 pin is not connected to external circuits, set both bits (disabling the clock output) to minimize noise and power dissipation. the com1 bits are cleared at system reset, unless modck = 01, in which case they are ones. this prevents clko1 and clko2 from both defaulting to an active state after reset, for all four combinations of the modck1-0 pins. this reduces the potential for system noise at reset. clko1 may be enabled later, if desired. 00 = clock out enabled, full-strength output buffer 01 = clock out enabled, 2/3-strength output buffer 10 = clock out enabled, 1/3-strength output buffer 11 = clock out disabled (driving 1). note if a continuous clock source is needed by the user when mod- ck = 01, then the user should use the output of the external os- cillator instead of the clko1 pin. the sum of strength of clko1 and clko2 should not exceed 1. (if com2 is set to 2/3 drive configuration, then com1 cannot be greater than 1/3 drive configuration) when modck is set to 01, clocko1 is disabled at reset until the com1 bit is changed. the clko1 logic is as follows: when com1 bits in the clkocr = 11, clko1 is driven high; when com1 bits in the clkocr 1 11, clko1 is driven accord- ing to the following conditions: a. driven low if the pll is not locked and reseth is asserted. b. driven with the same frequency as extal clock if the pll is locked. c. driven low if the pll unlocked due to mf change. 6.9.3.10 pll control register (pllcr). the pllcr controls the operation of the pll. it can be read or written only in supervisor mode. writing into this register is allowed only if the pllwp bit is zero. the reset state of pllcr produces an operating frequency of 13.14 mhz when the pll is referenced to a 32.768-khz crystal or to 4.192 mhz. two pins (modck1?odck0) are sampled during hardware reset (see table 6-1). note: the default value is one unless modck1-modck0 pins are tdriven with 00 during reset. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 pllen pllwp preen stsim mf11 mf10 mf9 mf8 mf7 mf6 mf5 mf4 mf3 mf2 mf1 mf0 reset: 1* 0 0 0 0 0 0 modck1 modck1 0 0 modck1 0 0 0 0
system integration module (sim60) motorola mc68360 user? manual 6-41 pllen?ll enable bit the quicc does not support disabled pll. the bit is always set to one on reset unless the modck1-modck0 pins are driven with 00 during reset. this mode of modck (00) is reserved as indicated in 2.1.10.4 clock mode select (modck1?odck0). pllwp?llcr write protect this bit protects accidental writing of the pllcr. after reset, this bit defaults to zero to enable writing. setting this bit prevents further writing (excluding the first write that sets this bit). preen?rescaler enable this bit controls the divide-by-128 prescaler on the extal signal. this bit is set during hardware reset only if the modck1?odck0 pins specify that the divide-by-128 pres- caler is used. it may be read thereafter as a status. if it is ever modified by software, it should be changed at the same time that the corresponding change in the mf bits is per- formed. 0 = the divide-by-128 prescaler is disabled. clkin = extal?he pll input clock fre- quency is the extal frequency. 1 = the divide-by-128 prescaler is enabled. clkin = extal/128?he pll input clock frequency is the extal frequency divided by 128. stsim?top mode simclk 0 = when the lpstop instruction is executed, the simclk is driven from the crystal. the frequency is either extal/2 or extal/256, depending on the divide-by-128 option. the pll is disabled to conserve power. 1 = when the lpstop instruction is executed, the sim60 clock is driven from the vco. mf11?f0?ultiplication factor these bits define the multiplication factor that will be applied to the pll input frequency. the multiplication factor can be any integer from 1 to 4096. the system frequency is ((mf bits + 1) extaldiv), where extaldiv is either extal or extal/128, depending on the modck bit configuration. the multiplication factor must be chosen to ensure that the result- ing vco output frequency will be in the range from 10 mhz to the maximum allowed clock input frequency (e.g., 25 mhz for a 25-mhz device). in addition, the vco outputs a 2 fre- quency signal, which is 2 the multiplied value configured in the mf bits. this frequency is not used in any of the mf calculations. the value 000 results in a multiplier value of 1; the value $fff results in a multiplier value of 4096. anytime a new value is written into the mf11?f0 bits, the pll will lose the lock condition and, after a delay, will relock. when the pll loses its lock condition, all clocks generated by the pll are disabled. after a hardware reset, the mf11?f0 bits default to either 0 or 400 ($190 hex), depending on the modck1?odck0 pins (giving a multiplication factor of 1 or 401). if the multiplication factor is 401, then a standard 32.768-khz crystal generates an ini-
system integration module (sim60) 6-42 mc68360 user? manual motorola tial general system clock of 13.14 mhz. the user would then write the mf bits to raise this frequency to the desired frequency. note swt clocking does not stop when the pll is in the process of acquiring a lock. therefore, the user should service the swt (re- set its count) before and after changing the mf bits. 6.9.3.11 clock divider control register (cdvcr). the cdvcr controls the operation of the low-power divider for the various clocks on the quicc. it can be read or written only in supervisor mode. writing this register is allowed only if the cdvwp bit is zero. the reset state of cdvcr produces the maximum frequency for all the clocks that it affects. cdvwp?dvcr write protect this bit protects accidental writing of the cdvcr. after reset, this bit defaults to zero to enable writing. setting this bit prevents further writing (excluding the first write that sets this bit). dfsy?ivision factor for the syncclk these bits define the syncclk frequency. changing the value of the these bits will not result in a loss-of-lock condition. these bits are cleared by a hardware reset. the default value is divide by 1 (vco/2) which is 25 mhz in a 25-mhz system. 00 = divide by 1 (normal operation) 01 = divide by 4 10 = divide by 16 11 = divide by 64 dftm?ivision factor for the brgclk these bits define the brgclk frequency. changing the value of the these bits will not result in a loss-of-lock condition. these bits are cleared by a hardware reset. the default value is divide by 1 (vco/2) which is 25 mhz in a 25-mhz system. 00 = divide by 1 (normal operation) 01 = divide by 4 10 = divide by 16 11 = divide by 64 inten?nterrupt enable these bits specify if the general system clock returns to high frequency (defined by the dfnh bits) while the cpu32+ either has a pending interrupt or an interrupt routine in pro- cess, either of which has a level higher than inten2?nten0. to prevent interrupts from causing the general system clock to automatically switch to high frequency, write inten with 111. 1514131211109 8 7 654321 0 cdvwp dfsy dftm inten rrqen dfnl dfnh csrc 0 0000000 0 000000 0
system integration module (sim60) motorola mc68360 user? manual 6-43 rrqen?isc request enable this bit specifies if the general system clock returns to high frequency (defined by the dfnh bits) while the cpm risc controller is not idle. 0 = remain in lower frequency (defined by dfnl) even if the risc controller is not idle. 1 = switch to the high frequency (defined by dfnh) when the risc controller needs to execute a routine. dfnl?ivision factor lowest frequency these bits are required in two cases: 1) to reduce the general system clock to a frequency lower than that which can be obtained in dfnh and 2) to automatically switch between the dfnl rate and the dfnh rate. see 6.5.5 quicc internal clock signals for details on how to automatically switch between the dfnh rate and the dfnl rate. the user may load these bits with the desired divide value, and then set the csrc bit to change the frequency. changing the value of the these bits will never cause a loss-of-lock condition. these bits are cleared by a hardware reset. 000 = divide by 2 001 = divide by 4 010 = divide by 8 011 = divide by 16 100 = divide by 32 101 = divide by 64 110 = reserved 111 = divide by 256 dfnh?ivision factor high frequency changing the value of these bits will never cause a loss-of-lock condition. these bits are cleared (divide by 1) by a hardware reset. the default value is divide by 1 (vco/2), which is 25 mhz in a 25-mhz system. the user may write the dfnh bits at any time to change the general system clock rate. see 6.5.5 quicc internal clock signals for details on how to automatically switch be- tween the dfnh rate and the dfnl rate. 000 = divide by 1 (normal operation of general system clock when csrc = 0) 001 = divide by 2 010 = divide by 4 011 = divide by 8 100 = divide by 16 101 = divide by 32 110 = divide by 64 111 = reserved csrc?lock source bit the csrc bit specifies whether the general system clock is determined by the dfnh or the dfnl bits. setting this bit switches the general system clock to the dfnl value (i.e.,
system integration module (sim60) 6-44 mc68360 user? manual motorola for entering into low-power mode). clearing this bit switches the general system clock to the dfnh value. csrc is cleared at hardware reset. 0 = general system clock is determined by the dfnh value. 1 = general system clock is determined by the dfnl value. 6.9.3.12 breakpoint address register (bkar). this register contains the 32-bit breakpoint address used in the breakpoint address match function. its contents are only valid if the valid bit is set in the bkcr. bkar is undefined at reset. 6.9.3.13 breakpoint control register (bkcr). this register contains miscella- neous bits required for the breakpoint address match function. bkcr is cleared at reset. bits 31?0?eserved bas?reakpoint acknowledge support this bit determines whether to support the cpu32+ breakpoint acknowledge cycle by as- serting berr or ignore the breakpoint acknowledge cycle by allowing it to be handled by the external bus. 0 = no action taken during cpu32+ breakpoint acknowledge cycles. 1 = assert berr during cpu32+ breakpoint acknowledge cycles. note do not assert this bit if the quicc is in slave mode. buss?us select this bit determines whether the breakpoint logic will use the imb value or the external bus value to detect breakpoint match. 0 = use the imb. 1 = use the external bus. a0 and a1 are masked from the comparison. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 ba31 ba30 ba29 ba28 ba27 ba26 ba25 ba24 ba23 ba22 ba21 ba20 ba19 ba18 ba17 ba16 u uuuuuuuuuuuuuuu 1514131211109876543210 ba15 ba14 ba13 ba12 ba11 ba10 ba9 ba8 ba7 ba6 ba5 ba4 ba3 ba2 ba1 ba0 u uuuuuuuuuuuuuuu 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 basbussrw1rw0 0000 1514131211109876543210 sizm siz1 siz0 neg ma1 ma0 as8 as7 as6 as5 as4 as3 as2 as1 as0 v 0000000000000000
system integration module (sim60) motorola mc68360 user? manual 6-45 notes this mode is used in quicc slave operation to assert either the bkpto line for the external cpu or the internal imb bkpt line for an internal-to-internal idma/sdma access. when the exter- nal bus is used, the breakpoint line will be asserted as if the sizm bit is set. in the case of an external mc68040 burst, only the first address of the burst is checked. when the quicc is in master mode this bit should be zero to prevent external breakpoint from being ignored. rw1?w0?ead/write selection assert a breakpoint match on read cycles only, write cycles only, or on both. 00 = assert breakpoint on read cycles. 01 = assert breakpoint on write cycles. 10 = assert breakpoint on read or write cycles. 11 = reserved. sizm?ize mask this bit determines whether the breakpoint logic will use the siz bits to determine whether a breakpoint match has occurred. 0 = compare the size lines as programmed in the siz bits to determine whether a breakpoint match has occurred. note this mode would normally be used to break on an access to a location that contains data. 1 = mask the size lines. the size of the access is not used in determining whether a breakpoint match has occurred. the breakpoint logic will assert the break signal when the address and size overlaps the programmable value. for example if the programmable address is xxx2, the breakpoint line for the low word will be asserted when the access address is xxx2 with a word size or when the address is xxx0 with a long-word size. note this mode would normally be used to break on an instruction fetch. siz1?iz10?ize bits the breakpoint logic can cause a breakpoint match for accesses that correspond to the size of the access. set the sizm bit to disable this feature.
system integration module (sim60) 6-46 mc68360 user? manual motorola notes the breakpoint logic will assert the break signal only when the address and size match the programmable value. for example, if the programmable address is xxx2 with word size, the break- point will be asserted only when the access address is xxx2 with word size, not when the address is xxx0 with long-word size. the ma bits must be 00 for the size comparison to occur. 00 = long word 01 = byte 10 = word 11 = 3 byte table 6-7. breakpoint and size pin programmed ba1-ba0 (bkar reg) imb/ext a1-a0 imb/ext siz1-siz0 assert bkpt 00 00 x yes 01 x no 10 x no 11 x no 01 00 00 yes 00 01 no 00 1x yes 01 x yes 1x x yes 10 00 00 yes 00 01 no 00 10 no 00 11 yes 01 00 yes 01 01 no 01 1x yes 10 x yes 11 x no 11 00 00 yes 00 01 no 00 1x no 01 00 yes 01 01 no 01 10 no 01 11 yes 10 00 yes 10 01 no 10 1x yes 11 x yes
system integration module (sim60) motorola mc68360 user? manual 6-47 note the table is true for the case sizm=1. breakpoint will be asserted only if the programmed address is actually accessed. table 6-7 shows which combinations of a0-a1 and siz1-siz0, on eitherthe external bus or the imb bus, assert the bkpt pin. neg?egative breakpoint match this bit allows the breakpoint match to occur, using negative address matching logic, when a block address is selected. if this bit is set, the rest of the address and address match logic define when a breakpoint match is not to occur. the r/w , size, and fc com- pare logic are not affected by the neg bit. 0 = assert a breakpoint when the memory cycle matches the programmed values. 1 = assert a breakpoint when the memory cycle does not match the programmed block address. neg is ignored if the ma bits are 00. ma1?a0?ask address the address mask bits allow the breakpoint logic to assert the breakpoint on a memory block boundary. 00 = no address bits are masked, 32 address bits are compared. 01 = mask address bits 10?; the block size is 2k. 10 = mask address bits 12?; the block size is 8k. 11 = mask address bits 14?; the block size is 32k. note using the neg bit, the breakpoint can be asserted for accesses that fall into the block range or for those that fall out of the block range. as8?s0?ddress space bits the address space field allows particular address spaces (function code combinations) to be masked during the breakpoint match decision. if an address space is masked, an ac- cess to this space will not assert the bkpt pin. to ignore function codes in the break- point match decision, program these bits to zero. the address space bits are: as8?ask dma space address space (fc3?c0 = 1xxx) as7?ask cpu space address space (fc3?c0 = 0111) as6?ask supervisor program address space (fc3?c0 = 0110) as5?ask supervisor data address space (fc3?c0 = 0101) as4?ask [motorola reserved] address space (fc3?c0 = 0100) as3?ask [user reserved] address space (fc3?c0 = 0011) as2?ask user program address space (fc3?c0 = 0010) as1?ask user data address space (fc3?c0 = 0001) as0?ask [motorola reserved] address space (fc3?c0 = 0000)
system integration module (sim60) 6-48 mc68360 user? manual motorola the address space bits for 040 type mpu are: as8?ot relevant for 040 cycles as7?cknowledge access(tt1-tt0=11) as6?upervisor code access(tt1-tt0=00, tm2-tm0=110) as5?upervisor data access(tt1-tt0=00, tm2-tm0=101) as4?mu table search code access (tt1-tt0=00, tm2-tm0=100) as3?mu table search data access(tt1-tt0=00, tm2-tm0=011) as2?ser code access(tt1-tt0=00, tm2-tm0=010) as1?ser data access(tt1-tt0=00, tm2-tm0=001) as0?ata cache push access(tt1-tt0=00, tm2-tm0=000) for each address space bit: 0 = a breakpoint match can occur for this address space. 1 = mask this address space from the breakpoint match logic. no breakpoint match will occur if this address space is used on a bus access. v?alid this bit indicates when the contents of the breakpoint address register and breakpoint control register pair are valid. bkpt signal will not be asserted unless the valid bit is set. 0 = contents not valid. 1 = contents valid. 6.9.4 port e pin assignment register (pepar) the pepar controls the i/o pins associated with the ebi. refer to section 4 bus operation for more information about the ebi. port e pins can be independently programmed to be either cas3?as0 or iack6 and iack3 ?ack1 ; avec (or aveco ) or iack5 ; cs3 or iack7 ; amux or oe ; a31?28 or we3 ?e0 . until the low byte of pepar is written, the we3?e0 /a31?28 pins are three-stated. the pww bit indicates whether the low byte of pepar was written. pepar may be read or writ- ten at any time. bits 15, 11, and 3?eserved 15 14 13 12 11 10 9 8 sintout cf1mode ipipe1/ ras1dd 00000000 76543210 a28?31 we0?e3 oe/ amux pww cas2, 3 iack3, 6 cas0, 1 iack1, 2 cs7 iack7 avec or ( aveco)/ iack5 00000000
system integration module (sim60) motorola mc68360 user? manual 6-49 bits 14?2?intout these bits should only be modified from its default when the quicc is configured in slave (disable cpu32+) mode. they are used to program the way the interrupt controller will assert its interrupt requests to the external logic. 000 = default (used only in cpu enable mode). 001 = reserved. 010 = the quicc interrupt request is the rqout output function on the irq1 pin. 011 = the quicc interrupt request is the iout2 ?out0 outputs with the standard m68000 family interrupt level encoding on the irq6 , irq4 , and irq1 pin, re- spectively. 100 = the quicc interrupt request is the rqout output function on the prty2 pin. 101 = the quicc interrupt request is the iout2 ?out0 outputs with the standard m68000 family interrupt level encoding on the prty0?rty2 pins, respective- ly. 110 = reserved. 111 = reserved. note until the low byte of pepar is written, the parity lines will be three-stated. the user should write the high byte of pepar at the same time that the low byte is written to avoid selecting a re- served combination of the sintout bits. bits 10??f1mode these bits are used to control the config1/bclro /ras2dd pin functionality. 00 = config1 input pin function is chosen. 01 = config1 input pin function is chosen. 10 = the bclro output function is chosen instead of the config1 pin. 11 = ras2dd output function (ras2 double-drive) is chosen instead of the config1 pin. bit 8?pipe1 /ras1dd 0 = if the quicc is in normal mode, the ipipe1 output function is selected. if the quicc is in slave mode, the bclri input function is selected. 1 = the ras1dd output function (ras1 double-drive) is selected. bit 7?31?28/we0 ?e3 0 = the a31?28 input/output functions are selected. 1 = the we0 we3 output functions are selected. note until the low byte of pepar is written, the we3 we0 /a31-28 pins are three-stated. bit 6?e /amux 0 = the oe output function is selected. 1 = the amux output function is selected.
system integration module (sim60) 6-50 mc68360 user? manual motorola bit 5?ww this read-only bit is used to indicate if the we /addr and the prty lines have been pro- grammed by the user or are still in the three-state condition because the pepar register has not been written. 0 = pepar has not been written. the we /addr and the prty lines are still being three-stated. 1 = pepar was written. the we /addr and the prty lines have been programmed in the pepar, so the configuration choices of these pins in the pepar are valid. bit 4?as2 , cas3 /iack3 , iack6 0 = the cas2 and cas3 output functions are selected. 1 = the iack3 and iack6 output functions are selected. bit 2?as0 , cas1 /iack1 , iack2 0 = the cas0 and cas1 output functions are selected. 1 = the iack1 and iack2 output functions are selected. bit 1?s7 /iack7 0 = the cs7 output function is selected. 1 = the iack7 output function is selected. bit 0?vec (aveco) /iack5 0 = the avec input function is selected in normal operation, or aveco is selected in slave mode. 1 = the iack5 output function is selected. 6.10 memory controller the memory controller is a sub-block of the sim60 that is responsible for up to eight general- purpose chip-select lines and the dram controller. the dram controller itself can control up to eight memory banks. 6.10.1 memory controller key features the key features of the memory controller are as follows: all eight memory banks support the following: ?2-bit address decode with 17 bits of address masking ?arious block sizes? kbytes up to 256 mbytes ?rom 0 to 15 wait states programmable with dsack generation ?emory bank can be used by an external master ?upports burst accesses of the mc68040 ?yte parity generation/checking ?rite-protect capability ?our byte-write enable (we ) signals ?utput enable (oe ) signal ?pecial options for interfacing to slow peripherals ?unction code match with mask can qualify memory bank accesses
system integration module (sim60) motorola mc68360 user? manual 6-51 general-purpose chip selects (sram banks) ?ay be used with sram, eprom, feprom, and peripherals ?lobal (boot) chip select available at system reset ?wo-clock accesses to external sram ?rogrammable port size of 8, 16, and 32 bits for each chip select dram controller (dram banks) ?upports up to eight banks of dram of size 128k x, 256k x, 512k x, 1m x, 2m x, 4m x, 8m x or 16m x ?upports a dram port size of 16 or 32 bits ?nternal address multiplexing for 16- and 32-bit dram systems available for all on- chip bus masters ?lueless interface to one bank of dram simms (only external buffers are re- quired for additional simm banks) ?our cas lines ?wo of the eight ras lines may be output on two pins each for double-drive ca- pability ?age mode with page switch detection logic ?age mode supports 128k, 256k, 512k, 1m, 2m, 4m, 8m, and 16m page banks ?upports page mode normal, page hit, and page miss ?urst support for the mc68040 accesses to dram dram controller also contains a refresh unit with: ?as before ras refresh support ? programmable refresh timer ?efresh active during external reset ?isable refresh mode ?tacking of up to seven refresh cycles dram controller also supports external masters ?upports mc68ec040 with 3,2,2,2 line fill (60-ns drams) ?upports dram for external quicc or mc68030-type accesses (page support available in this mode) ?upports dram control for system bus containing external mc68ec040 and mul- tiple quiccs ?ynchronous and asynchronous external masters possible ?pecial options for external master to improve dram performance 6.10.2 memory controller overview the block diagram of the quicc memory controller is shown in figure 6-10. the general- purpose chip selects provide a glueless interface to eprom, sram, flash eprom (feprom), and other peripherals. the general-purpose chip selects are available on lines cs0 ?s7 . cs0 also functions as the global (boot) chip select for accessing the boot eprom. the chip selects allow 0 to 15 wait states. the flexible memory controller allows a glueless dram interface to single in-line memory modules (simms) as well as a grid array of drams on a board. the dram controller con- trols the address multiplexing, access mode, refresh operation, and the timing generation
system integration module (sim60) 6-52 mc68360 user? manual motorola for up to eight banks of drams. the dram controller provides eight ras lines for up to eight dram banks, four cas lines and four parity (prty) lines (one for each data byte on the quicc system bus), and a parity error signal (perr ). the dram controller also pro- vides multiplexed address lines for on-chip bus masters and an address mux signal (amux) to support an external address muxing for external masters that wish to use the quicc dram controller for their accesses to dram. the dram controller also fully supports an external mc68ec040 (or other mc68040 family variations) with the signals badd2, badd3, ta , ts, and tbi . alternatively, a general-purpose chip select may be used instead of any dram bank. note when one of the eight banks of memory is configured to control dram, it is referred to as a dram bank. when one of the eight banks of memory is configured to control standard memory (such as sram and eprom) or a peripheral, it is referred to as an sram bank. thus, the term ?ram bank?is used to mean ?on-dram?in this description. some features are common to all eight memory banks. first, a full 32-bit address decode for each memory bank is possible, with 17 bits having address masking. the full 32-bit decode is available, even if all 32 address bits are not brought outside the quicc. each memory bank includes a variable block size from 2 kbytes up to 256 mbytes). from 0 to 15 wait states may be programmed with dsack generation. the memory bank can be used by an external master, including the mc68ec040, in which case burst accesses are also supported. parity may be generated and checked for any memory bank (sram, dram, etc.). each memory bank may be selected for read-only or read/write operation. byte-write enable (we ) signals are available for each byte that is written to memory. also, an output enable (oe ) signal is provided to eliminate external glue logic. finally, the access to a mem- ory bank may be restricted to only certain function codes for system protection. the function code comparison occurs with a mask option also. the memory controller functionality allows quicc-based systems to be built very easily. for instance, a minimal quicc system may require no glue logic as shown in figure 6-11. in this example, cs0 is used for the boot eprom, and ras1 is used for the dram simm. the we signals are used to simplify the interface to the dram simm, and the oe signal is used to simplify the interface to the eprom. byte parity is supported in this configuration. note: if the we signal of the quicc is used to control memory write operation, unless the memory width is 32 bit, the user must specify the correct memory width with the sps0-1 bits of the op- tion register. for example, if the sps is programed for a 16 bit port size, only we0 and we1 will be asserted. if external asser- tion of dsack is used due to the algorithm of dynamic bus siz- ing, the first bus cycle assumes a 32 bit port size and will output we for 32bit regardless of external dsack encoding.
system integration module (sim60) motorola mc68360 user? manual 6-53 . figure 6-10. memory controller block diagram option register (or) encoder we3?e0 cas3?as0 ras7?as0/cs7?s0 dsack1?sack0 amux oe option register (or) base register (br) perr wp perr address latch and mux sdbadd3?dbadd2 page_miss gamx bit ref_req (br8) sdmadd1?dmadd13 burst counter base register (br) page logic ext/imb?c/tm,tt; a31?0 refresh counters (3, 12 bits) ref_ack. global memory register (gmr) chip select attributes expired select load wait-state counter (4 bit) as, ts, size, breq, rd/wr memory controller status (mstat) parity logic prty3?rty0 ta, tbi timing generator and logic control ras0/cs0 ras1/cs1 ras2/cs2 ras3/cs3 ras4/cs4 ras5/cs5 ras6/cs6 ras7/cs7 bank_miss d31?0, prty3?rty0
system integration module (sim60) 6-54 mc68360 user? manual motorola figure 6-11. minimum quicc system configuration if a larger system is required, the only additional glue logic that may be needed is external buffers (see figure 6-12). in this case, a boot eprom and a flash eprom are supported. also, two dram simms are supported using ras1 and ras2 . each of the eight memory banks may be used by an external master such as an mc68ec040, mc68030, or even another quicc. whenever an external master accesses dram, sram, or a peripheral within one of the regions of the memory banks, the memory controller will control the access for that external master. if dram is accessed by an external master, an external multiplexer must be provided. in that case, the quicc amux signal can be used to control the multiplexing. the dram con- troller supports use by an mc68ec040 and another quicc or mc68030-type device. in such a case, the mc68ec040 and quicc/mc68030-type device can access the dram in different modes and at different rates. for instance, the mc68ec040 can access the dram using two-clock bursts, while an external quicc accesses the dram using page mode with three-clock page hits, four-clock page normal, and five-clock page miss accesses. thus, the mc68ec040 access to dram is not slowed by the presence of other slower masters on the system bus. in addition, the mc68ec040 is not slowed by the performance of the dram accesses by the quicc's internal bus masters (cpu32+, idmas, sdmas, etc.) all accesses may occur at different rates, with the mc68ec040 parameters being programmed independently and the external quicc/mc68030-type master being up to one wait state quicc mc68360 ce (enable) oe (output enable) we (write) data address 8-bit boot eprom (flash or regular) cs0 oe we0 data address ras cas3?as0 w (write) data address parity 16- or 32-bit dram simm (optional parity) ras1 cas3?as0 r/w prty3?rty0
system integration module (sim60) motorola mc68360 user? manual 6-55 slower than the quicc's internal bus masters. the external master may be either synchro- nous or asynchronous with respect to the quicc system clock, with the exception of the mc68ec040, which must always be synchronous with respect to the quicc system clock. thus, if a 25-mhz quicc is used, a 25-mhz mc68ec040 should also be used. if an external mc68040 master does not use the memory controller at all, then the quicc can operate asynchronously to the mc68040, but the quicc mc68040 companion mode signals cannot be used, and the mc68040 bus signals must be converted to mc68030-type bus signals before the mc68040 accesses the quicc's internal ram and peripherals. figure 6-12. larger quicc system configuration quicc mc68360 ce (enable) oe (output enable) we (write) data address 8-bit boot eprom (flash or regular) cs0 oe we0 data address ras cas3?as0 w (write) data address parity 16- or 32-bit two-dram simms (optional parity) ras1 cas3?as0 r/w ras buffer e (enable) g (output enable) w (write) data address 8-, 16-, or 32-bit sram cs7 we3?e0 ras2 prty3?rty0
system integration module (sim60) 6-56 mc68360 user? manual motorola 6.11 general-purpose chip-select overview (sram banks) any memory bank that is not used to control dram may be used as a general-purpose chip select, including pins cs0 ?s7 . this bank is called an sram bank. these pins may be used to support external memory such as sram, eprom, flash eprom, eeprom, and peripherals. the sram banks also have some unique features not available in the dram banks. first, upon system reset, a global (boot) chip select is available. this provides a boot rom chip select before the system is fully configured. second, the sram banks offer two-clock accesses to external sram. finally, each sram bank supports a choice of the port size of its memory or peripheral to be 8, 16, or 32 bits with proper dsack generation for those port sizes. thus, an 8-bit eprom may be used with a 32-bit sram, etc. 6.11.1 associated registers the general-purpose chip selects are controlled by the global memory register (gmr) and the memory controller status register (mstat). there is one gmr and mstat in the mem- ory controller. additionally, each sram bank has a base register (br) and an option register (or). the gmr is used to control global parameters for both sram and dram banks. the mstat reports write protect violations and parity errors for both sram and dram banks. the br and the or for each of the general-purpose chip selects program most of the fea- tures. the br contains a valid (v) bit to indicate that the register information for that chip select is valid. 6.11.2 8-, 16-, and 32-bit port size configuration the general-purpose chip selects support dynamic bus sizing. defined 8-bit ports are acces- sible on both odd and even addresses when connected to data bus bits 31?4; defined 16- bit ports can be accessed as odd bytes, even bytes, or even words when connected to data bus bits 31?6; and defined 32-bit ports can be accessed as odd bytes, even bytes, odd words, and even words or long words on long-word boundaries. the port size is specified by the sps bits in the or. 6.11.3 write protect configuration the wp bit in each br can restrict write access to its range of addresses. any attempt to write this area will result in the wper bit being set in the mstat. 6.11.4 programmable wait state configuration the general-purpose chip selects support internal dsackx generation. they allow fast two- clock accesses to external memory by an internal bus master; from zero-wait-state accesses (3 clocks) up to 14-wait-state accesses (17 clocks) are allowed for internal bus masters. for external bus masters, two-clock accesses are not allowed, but 14 wait states may be programmed. additionally, if the emws bit is set in the gmr, the chip selects can
system integration module (sim60) motorola mc68360 user? manual 6-57 provide one additional wait state for external masters, giving up to 15 wait states by the chip selects. this is programmed using the tcyc bits in the or. 6.11.5 address and address space checking the defined base address is written to the br. the address mask bits for that address are written to the or. the function code access value, if desired, is written to fc bits in the br. the fcm bits in the or may be used to mask this selection. if the address space (function code) checking is not desired, program the fcm bits to zero. also, the chip select can be configured not to assert during cpu space (i.e., interrupt acknowledge) cycles that have a function code value 0111. this option is decided with the ncs bit in the gmr. 6.11.6 sram bank parity parity can be configured for any sram bank. parity is generated and checked on a per-byte basis using prty3?rty0 if the paren bit is set in the br. the opar bit in the gmr determines the type of parity (odd or even), and the pbee bit in the gmr determines if an internal master should generate an error as a result of a parity error. any parity error acti- vates the perr pin until the associated perx bit in the mstat is cleared. note asynchronous external masters do not have parity support. dw40 bit in the gmr must be set to support parity with external 040 master. parity is not supported for bus cycles terminated with external assertion of dsack or ta . 6.11.7 external master support the sram banks support the internal bus masters, such as the cpu32+, idmas, and sdmas, as well as external bus masters, such as the quicc, mc68030, or mc68ec040. in the case of an external master, an additional wait state may be programmed into the sram bank to compensate for the additional decoding time. this capability is programmed in the emws bit of the gmr. the mc68ec040 must always be synchronous to the quicc clock. the sram bank sup- ports bursting by the mc68ec040 if the back40 bit in the br is set. during this access, cs , prtyx, perr , dsack /ta /tbi , and baddr3?addr2 are all valid signals. the sram bank waits for the mc68ec040 ts line to be asserted before starting any mc68ec040 access. burst (line fill) transfers are also supported. the chip-select logic supports mc68030/quicc external masters in two modes. in the asynchronous mode, the logic asserts the cs and dsack lines as soon as an address match is detected from the external master. the chip select in this mode is waiting for the external master? as line to be asserted. in the synchronous mode, the cs and dsack assertion and negation timings are synchronous. the synchronous mode is programmed in the sync bit of the gmr.
system integration module (sim60) 6-58 mc68360 user? manual motorola when more wait states are programmed into the tcyc bits of the or, the external as (or ts line) is synchronized internally. the baddr3?addr2 signals equal the a3?2 signals when a burst is not in progress. this configuration allows a non-bursting master to access the same memory as a bursting external master by using the baddr3?addr2 signals. 6.11.8 global (boot) chip-select operation global (boot) chip-select operation allows address decoding for a boot rom before system initialization occurs. cs0 is the global chip-select output. its operation differs from the other external chip-select outputs following a system reset. when the cpu32+ begins accessing memory after a system reset, cs0 is asserted for every address, unless the mbar is accessed or an internal peripheral on the imb is accessed. the global chip select provides a programmable port size at system reset using the config pins. this capability allows a boot rom to be located anywhere in the address space (with up to 14 wait states), while still providing the stack pointer and program counter values at $00000000 and $00000004, respectively. the global chip select does not provide write pro- tection and responds to all function codes. cs0 operates in this manner until the first write to the cs0 option register (or0). cs0 can be programmed to continue decoding a range of addresses after this write, provided the desired address range is first loaded into base reg- ister 0. after the first write to the or0, the global chip select can only be restarted with a system reset. 6.11.9 sram bus error the berr signal may be asserted by the sram controller in the case of a parity error or by the bus monitor of the sim60 as a result of a write-protect violation. in addition, if the berr signal is asserted externally, it should not be asserted until at least s2 of the bus cycle. 6.12 dram controller overview (dram banks) the dram controller supports a glueless interface to 16-bit (18 bit with parity) or 32-bit (36 bit with parity) dram or dram simms from an internal quicc master (cpu32+, idmas, sdmas). many different dram bank sizes are supported: 128k, 256k, 512k, 1m, 2m, 4m, 8m, and 16m; thus, drams such as 128k x 8, and 16m x 4 are supported. the dram con- troller performs the address multiplexing for internal masters using the low-order address lines. table 6-8 lists the physical address lines of the dram (row and column). in the case of a 16-bit dram port size with a 512k dram device (e.g., two 512k x 8 devices for a total of 16 bits wide), the row address to the dram bank will be a19?10, and the column address to the dram bank will be a9?1. however, these signals will be internally multiplexed on the a10?1 pins; thus, the user should connect a10?1 to the address pins on each 512k dram device.
system integration module (sim60) motorola mc68360 user? manual 6-59 when there are external masters on the system bus, an external multiplexer should be used for the dram banks that are accessed by the external masters. the dram controller pro- vides this timing with the amux line. the dram controller supports byte-level parity for any dram bank. the dram controller use c as -before-ras refresh cycles. the refresh cycles are timed using a dedicated refresh timer. the refresh operation can be disabled. the dram controller supports normal access mode and several fast access modes: normal access mode. in this mode, each access to dram is handled independently using conventional dram timing. page mode. in this mode, the dram controller first establishes a constant row address, and then strobes a series of column addresses into the dram. the dram controller strobes both a row and a column address into the dram on the first access, but from that point on, it strobes only column addresses into the dram during access periods to the same dram page. after each access, the cas signal is negated. the ras line re- mains asserted until a different dram bank is accessed. note this mode is not supported for external mc68040 masters. burst mode. in this mode, the dram controller detects the mc68ec040 line transfer and strobes both a row and a column address into the dram on the first access, but from that point on, it strobes only column addresses into the dram. for this access, the dramc internally generates address lines 2 and 3 on the badd3?add2 pins. note burst mode is supported for the mc68xx040 type master only. during all dram accesses, ras , cas , r/w and dsack /ta are valid signals. the following paragraphs detail the operation of each dram controller access type. table 6-8. address multiplexing address lines (32-bit port) address lines (16-bit port) physical address physical address dram size column row dram address column row dram address 128k a2? a10?8 a2?0 a1? a9?7 a1? 256k a2?0 a11?9 a2?0 a1? a10?8 a1? 512k a2?0 a11?0 a2?1 a1? a10?9 a1?0 1m a2?1 a12?1 a2?1 a1?0 a11?0 a1?0 2m a2?1 a12?2 a2?2 a1?0 a11?1 a1?1 4m a2?2 a13?3 a2?2 a1?1 a12?2 a1?1 8m a2?2 a13?4 a2?3 a1?1 a12?3 a1?2 16m a2?3 a14?5 a2?3 a1?2 a13?4 a1?2
system integration module (sim60) 6-60 mc68360 user? manual motorola 6.12.1 dram normal access support when accessing a dram, the dram controller uses the ras and cas pins. when an access to a dram memory bank is made, a normal cycle occurs when dssel = 1 in the or, pgme = 0 in the or, and back40 = 0 in the br. the timing of the cycle is program- mable using the tcyc bits in the or. a normal dram access can also be made by an external mc68ec040. in this case, the wbt40 bit determines the ras precharge time, and the tss40 bit determines how ts is sampled. a normal dram access can also be made by an external mc68030/quicc. in this case, the wbtq bit determines the ras precharge time. the dram controller initiates a transaction by driving the row address on the low address lines. after the value on the address pins is the row address, the dram controller asserts ras . one clock phase later, the column address is driven on the low address lines as defined by the programmed dram size, and a clock phase later, the cas signal is asserted. if the cycle is a write transfer, then data is output at that point. the dram controller then waits for the expiration of the tcyc length attribute and completes the cycle. the next cycle will begin only after the value programmed in the wbtq field expires. the assertion of ras can be delayed by one clock phase to relax the address to ras timing by setting the trlxq bit in the br. when this bit is set the column address is driven one clock later, and cas is delayed by one clock (see figure 6-16). the dram controller may also generate and check four parity lines (prty3?rty0). the parity can be either odd or even as programmed with the opar bit in the gmr. during write cycles, the dram controller generates the parity on the four parity lines. during a read cycle, the dram controller checks the parity. if the paren bit in the br is set when a parity error occurs, the dram controller asserts the perr line and sets the perx bit in the mstat. for internal cycles, the dram controller will assert berr when a parity error occurs and the pbee bit in the gmr is set. note read-modify-write cycles may be performed using the dram controller. these are implemented as a read cycle followed by a write cycle. some drams offer a special read-modify-write ac- cess using special timing. this access timing is not supported by the quicc's dram controller. 6.12.2 dram page mode support the dram banks supports a page mode memory access to drams for the internal masters and for an external quicc/mc68030-type master. a memory bank is configured to page mode if its dssel and pgme bits in the or are set. many drams support a page mode operation that reduces access time if multiple accesses are performed within the same page. in this mode, the dram controller continues to assert
system integration module (sim60) motorola mc68360 user? manual 6-61 the ras signal of the dram bank. this ras signal will remain active until another dram bank is accessed. the page size is determined by the pgs bits in the gmr. if a different bank of dram is accessed, followed by an access to a dram bank on which page mode is selected, then the dram controller negates the ras signal to the other bank and asserts the particular ras line for the page mode bank, followed by the rest of the dram access. this is called a page mode normal cycle. on each access to a dram bank in which the page mode is enabled and the previous dram cycle was to that bank, the address of the last access to this bank is compared to the current address. if the two addresses fall within the same page, then the access cycle begins immediately with the assertion of the column address and cas signal. this is called a page hit. in case of a page miss (the address of the last access and current address do not fall within the same page), the ras signal must be negated and held high for a period that matches the value programmed in the wbtq control field of the current dram region, and then a full cycle (including row and column phases) is executed. this is the slowest dram access since the ras signal must first be negated, followed by the precharge time. since it is difficult to predict the performance impact of page mode, the user may wish to try the application software with and without page mode enabled, and compare the results. the ability to concentrate the code/data accesses into the same page of the dram is central to achieving a performance improvement. some systems will need an additional wait state to perform write cycles during a page hit. to gain a wait state, set the delay write cycle for the quicc dwq bit in the gmr of the dram bank. notes page mode is supported only for the internal quicc cycles or external mc68030/quicc cycles. if any two dram banks overlap each other in their address space, page mode must not be selected for either of those banks. 6.12.3 dram burst access support the dram controller supports burst accesses made by an external mc68ec040 (or other mc68040 family member) if the back40 bit is set in the br. the mc68ec040 requests a burst to be performed with a line-fill indication on the sizx pins (siz = 11) and the ttx pins. in this case, the dram controller performs a normal access (ras and cas ), followed by requests to the dram for the next three sequential long-word operands (cas only). the dram controller automatically increments the addresses to the dram using the baddr3 baddr2 pins. the length of an mc68ec040 burst cycle can be distinguished from the length of the initial access with the bcyc bits of the or.
system integration module (sim60) 6-62 mc68360 user? manual motorola 6.12.4 dram bank parity parity can be configured for any dram bank. parity is generated and checked on a per-byte basis using prty3?rty0 if the paren bit is set in the br. the opar bit in the gmr determines the type of parity (odd or even), and the pbee bit in the gmr determines if an internal master should generate an error as a result of a parity error. any parity error acti- vates the perr pin until the associated perx bit in the mstat is cleared. note asynchronous external masters do not have parity support. parity is not supported for bus cycles terminated with external assertion of dsack or ta . 6.12.5 refresh operation the dram controller uses c as -before-ras refresh cycles. the refresh cycles are timed using a dedicated refresh timer. in the cas -before-ras method, the drams have an inter- nal refresh row address counter, so row addresses need not be supplied by the dram con- troller. these drams recognize the assertion of cas before the assertion of ras and perform the refresh using their internal refresh row address value. each time the refresh timer expires, the dramc performs a refresh cycle. at the first oppor- tunity after acquiring bus mastership, the dram controller requests the bus with the highest bus arbitration priority level 6. in addition, it asserts the bclro signal to minimize the delay before the refresh cycle begins, assuming the external bus master recognizes this signal and clears itself off the bus. once the dram controller obtains the bus, it performs a refresh bus cycle to the dram bank. if more than one bank of dram exists in the system, the user should program the refresh controller to request the bus more often (n times as often, where n is the number of banks). for instance, typical drams require a refresh every 15.6 m s. if 2 banks of dram exist in the system, the dram controller should be programmed to refresh every 7.8 m s. in the two bank case, the dram controller will alternate between the banks, using the cas -before-ras technique on each bank every 7.8 m s. the dram controller will automatically stack up to seven refresh requests before receiving the bus mastership. once it receives the bus, it will perform all stacked cycles (up to seven), as sequential, back-to-back refresh bus cycles. refresh cycles are executed only when the rfen bit in the gmr is set. the refresh cycle length (three to six clocks) is programmed by the rcyc bits in the gmr. the time between refreshes is programmed in the rcnt bits in the gmr (see 6.13.1 global memory register (gmr)). note dram banks normally need eight read cycles and some delay time after a power-on reset. after enabling the dram bank, the
system integration module (sim60) motorola mc68360 user? manual 6-63 user can either perform the reads in software or wait for the dram refresh controller to perform these reads. 6.12.6 dram bank external master support the dram controller supports an external mc68ec040 as well as external mc68030-type masters, including an external quicc. whenever an external master is supported, external address multiplexing must be provided by the user. the dram controller controls the multiplexing with the amux pin. on a normal access, amux defaults high, and the upper address lines (row) should be multiplexed to the dram first. after the external master outputs the full address, it asserts the as /ts signal to the quicc. the dram controller then performs the address comparison, detects that the access is to one of its dram banks, and issues the corresponding ras signal. after the assertion of the ras signal, the dram controller continues the access and negates the amux signal, controls the cas and ras timing, and generates the dsack /ta signals to terminate the access. refer to section 9 applications for a description of an external master system. note to support the mc68030 cache fill operations, the dram con- troller asserts all four cas signals during every quicc/ mc68030-type external master read cycle to a dram bank. (this includes byte or word reads by the mc68030.) the dram controller supports the mc68ec040 in an optimized way. the dram controller supports burst accesses made by an external mc68ec040 (or other m68040 family mem- ber) if the back40 bit is set in the br. the mc68ec040 requests a burst to be performed with a line-fill indication on the sizx (siz = 11) and ttx pins. in this case, the dram con- troller performs a normal access (ras and cas ), followed by requests to the dram for the next three sequential long-word operands (cas only). the dram controller automatically increments the addresses to the dram using the baddr3?addr2 pins. 6.12.7 double-drive ras lines ras1 and ras2 have a special capability. to increase the available drive strength of these pins, the ras1 and ras2 signals may be output simultaneously on two pins each. the extra signals, called ras1dd and ras2dd , increase the effective drive strength of the ras sig- nals. this selection is made in the pepar. 6.12.8 dram bus error the berr signal may be asserted by the dram controller in the case of a parity error or by the bus monitor of the sim60 as a result of a write-protect violation. in addition, if the berr signal is asserted externally, it should not be asserted until at least s2 of the bus cycle if tss = 0 in the gmr, and until at least s4 of the bus cycle if tss = 1 in the gmr.
system integration module (sim60) 6-64 mc68360 user? manual motorola 6.13 programming model the user interfaces with the memory controller using eight identical sets of two registers, the br and or. there are also two global registers in the memory controller: the gmr and the mstat. 6.13.1 global memory register (gmr) the 32-bit read-write gmr contains selections that are common to the entire memory con- troller: dram refresh properties, dram bank properties, sram bank properties, and some global sram/dram properties. the reserved bits (4?) should be written with zero. supervisor space only the following bits are used for dram refresh properties. rcnt7?cnt0?efresh counter period these bits determine the refresh period according to the following equation: example: for a 25-mhz system clock and a required refresh rate of 15.6 m s per row, the rfcnt value should be 24 (decimal). 24/(25 mhz/16) = 15.36 m s, which is less than the required refresh period of 15.6 m s. rfen?efresh enable 0 = dram refresh is disabled. 1 = dram refresh is enabled. rcyc1?cyc0?efresh cycle length these bits determine the length of a refresh cycle. 00 = the refresh cycle is 4 clocks long, and ras is negated for 3 phases prior to being asserted. 01 = the refresh cycle is 6 clocks long, and ras is negated for 5 phases prior to being asserted. 10 = the refresh cycle is 7 clocks long, and ras is negated for 5 phases prior to being asserted. 11 = the refresh cycle is 8 clocks long, and ras is negated for 5 phases prior to being asserted. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 rcnt7 rcnt6 rcnt5 rcnt4 rcnt3 rcnt2 rcnt1 rcnt0 rfen rcyc1 rcyc0 pgs2 pgs1 pgs0 dps1 dps0 0000000000000000 1514131211109876543210 wbt40 wbtq sync emws opar pbee tss40 ncs dwq dw40 gamx 0001001000000000 refresh period = rfcnt+1 system clk/16
system integration module (sim60) motorola mc68360 user? manual 6-65 the following bits are used for dram bank properties: pgs2?gs0?age size this attribute determines the page size for the dram controller (see table 6-9). the page size is the smallest dram size the user needs to support with page mode capability. for instance, pgs = 001 (256k) should be used for a 32-bit-wide memory composed of four 256k 8 devices, a 16-bit-wide memory composed of two 256k 8 devices, or six- teen 256k 1 devices. in all cases, the width of the drams is irrelevant. dps1?ps0?ram port size this attribute determines the dram bank port size (see table 6-10). the dram controller asserts the appropriate dsackx lines according to these bits. if an mc68ec040 access is performed using this dram bank and sps = 00 or 01, the dram controller operates the same way, but asserts ta instead of dsack . notes the internal dram address multiplexer and the page logic sup- port only a port size of 32 bits or 16 bits. an 8-bit dram port size is not allowed. the dram controller does not support an external dsackx re- sponse for a bank on which page mode is used. also, an exter- nal dsack response may not occur before ras is asserted. table 6-9. dram page size pgs2-pgs0 address lines used # address/page in page compare 000 a10-25(32), a9-25(16) 256 addresses 001 a11-25(32), a10-25(16) 512 addresses 010 a11-25(32), a10-25(16) 512 addresses 011 a12-25(32), a11-25(16) 1024 addresses 100 a12-25(32), a11-25(16) 1024 addresses 101 a13-25(32), a12-25(16) 2048 addresses 110 a13-25(32), a12-25(16) 2048 addresses 110 a14-25(32), a13-25(16) 4096 addresses table 6-10. dram port size dps1?ps0 result 00 dram port size is 32 bits 01 dram port size is 16 bits 10 reserved 11 external dsackx support
system integration module (sim60) 6-66 mc68360 user? manual motorola the dram controller does not support an external ta response for the mc68040 burst mode. also, for non-burst mc68040 cy- cles, ta cannot be externally asserted before ras is asserted. wbt40?ait between transfers (mc68ec040) this attribute guarantees a minimum negation time for ras when the quicc dram con- troller is used by an external mc68ec040 master. it is used to comply with the ras pre- charge time in drams. the user would normally decide whether to set the tss40 bit before setting this bit. 0 = ras is negated for 4 phases of the quicc system clock (3 phases if tss40 = 1). 1 = ras is negated for 6 phases (5 phases if tss40 = 1). note tss40 affects the wbt40 value in order to gain back one of the two phases that was lost by setting tss40 = 1. this ?ain back only applies to back-to-back dram cycles. wbtq?ait between transfers (quicc-type) this attribute guarantees a minimum negation time for ras when the quicc dram con- troller is used by one of the internal masters or by an external master of the mc68030- type (includes an external quicc). it is used to comply with the ras precharge time in drams. 0 = ras is negated for 4 phases (3 phases in page mode?gme = 1). 1 = ras is negated for 6 phases (5 phases in page mode?gme = 1). dwq?elay write for quicc (dram bank only) this attribute is used to add a clock to the assertion and negation of the cas signal on dram page hit write cycles. the write cycle lasts one additional clock in this case. this attribute is applicable to an internal quicc master and to an external mc68030/quicc. 0 = reads and writes are the same length. 1 = add one clock to write cycles for dram banks where tcyc is set to 01. note this bit must be set by the user if page mode is enabled for this dram bank (pgme = 1), or else the dram may latch invalid data during writes. the following bits are used for sram bank properties: dw40?elay write for 040 (sram bank only) this attribute should be set if an additional wait state is necessary for sram write cycles. this attribute is applicable only to an external mc68040 writing to a non-dram bank. 0 = reads and writes are the same length. 1 = insert one additional wait state to mc68040 write cycles to sram banks.
system integration module (sim60) motorola mc68360 user? manual 6-67 emws?xternal master wait state (sram bank only) this attribute should be set if an additional wait state is necessary when an asynchronous external mc68030-type device or external quicc is accessing sram banks (see table 6-11). this bit is only used if sync = 0. 0 = normal operation. 1 = insert one additional wait state for external quicc/mc68030-type masters on their accesses to all sram banks.) note: the bstm bit is located in the mcr of the si60. the following bits are used for both dram and sram memory: sync?ynchronous external access mc68030-type this attribute applies only to an external mc68030-type device or external quicc that uses the on-chip memory controller. it determines how the memory controller will assert its signals in response to what it sees from the external master. 0 = asynchronous operation of the memory controller (external mc68030-type master only). when the sram controller is used, cs and dsack assertion and negation timings are asynchronous. they are asserted and negated in relation to the external master? as line. the csntq and the trlxq attributes are ignored. when emws is set, one wait state is added to the programmed tcyc. when the dram controller is used, cas and dsack are negated asynchronously with the negation of the external master? as . note the dram controller? assertion of ras and cas is always syn- chronous to the quicc clock. when asynchronous external masters are using the dram controller, the bstm bit in the mcr should be cleared. table 6-11. external mc68030-type cycle length (sram bank in asynchronous operation external quicc/mc68030-type bus cycle length synchronous bus timing (bstm = 1) asynchronous bus timing (bstm = 0) tcyc = emws = 0 emws = 1 emws = 0 emws = 1 0 3333 1 3435 2 4556 3 5667 4 6778 5 7889 6 89910 15 17 18 18 19
system integration module (sim60) 6-68 mc68360 user? manual motorola 1 = synchronous operation of the memory controller (external mc68030-type master only). when the sram controller is used, cs and dsack assertion and negation timings are synchronous. the csntq and the trlxq attributes may be set as desired. when the dram controller is used, cas and dsack are negated synchronously to the quicc clock. only when the sync bit is set, is parity support possible for an external mc68030-type master. table 6-12 summarizes the effects of the various combinations of the sync bit in the gmr and the bstm bit in the mcr.) notes: if synchronous bus mode is selected, glue logic is required for external mc68030-type bus master (including mc68360) ensuring that proper set up time for address strobe assertion is met opar?dd parity this attribute is used to program odd or even parity. it may also be used to generate parity errors for testing purposes by writing the dram/sram with opar = 1 and reading the dram/sram with opar = 0. 0 = even parity 1 = odd parity pbee?arity bus error enable this attribute is used to enable an internal bus error if a parity error is detected. it is ap- plicable only when the quicc is the bus master; if in slave mode the perr will be as- serted if the parity function is enabled but it will not cause bus error regardless of the setting of this bit. the berr signal will be internally asserted on the memory read cycle. 0 = disable internal bus error. 1 = enable internal bus error. note using the internal bus error requires a longer data setup time for read cycles. tss40?s sample (mc68ec040) this attribute is used to control the mc68ec040 cycles. when the mc68ec040 address to clock setup timing does not meet the memory controller decoding time, the memory table 6-12. sync-bstm bit combination summary (mc68030-type external master) sync-bstm result 00 mc68030-type master and quicc can be asynchronous. lowest performance, since the ex- ternal as signal is synchronized prior to being used. parity support is not available. 01 external mc68030-type master is running synchronously with the quicc, and the user desires to make external-to-external sram accesses as fast as possible. the csntq and trlxq at- tributes may not be used. does not affect dram performance. parity support is not available. 10 do not use. 11 not as fast as case 01, but csntq and trlxq attributes may be used. parity support is avail- able.
system integration module (sim60) motorola mc68360 user? manual 6-69 controller may sample ts with a one-clock-phase delay. this will delay the assertion of the cs or ras in the mc68ec040 memory cycle by one clock phase. it will delay the rest of the bus cycle by one clock (effectively adding one extra clock cycle per bus cycle). note in general, the user determines whether this bit must be set be- fore to selecting the wbt40 and tcyc bits. 0 = do not sample ts . 1 = sample ts prior to using it. ncs?o cpu space this attribute specifies whether the cs /ras signal will assert on a cpu space access cy- cle. if both supervisor data and program accesses are desired, while ignoring cpu space accesses, then this bit should be set. (note that an interrupt acknowledge cycle is a cpu space access, but a user or supervisor read/write cycle is not.) a cpu space access has the function code value 0111. 0 = assert cs /ras on cpu space accesses (default). 1 = suppress cs /ras on cpu space accesses. note in default state, user should program the fc3-fc0 in both the option registers and base registers so that cs/ras will not get asserted in an undesirable address range. gamx?lobal address mux enable this attribute determines whether the quicc will provide internal address multiplexing for dram banks. if not, the address multiplexing must be provided externally, with the quicc? amux pin being used to control the multiplexers. amux is high to signify the row, low to signify the column address, and then negated (high) at the end of the dram bus cycle. there are two situations in which the user may wish to provide address multiplexing ex- ternally. first, external multiplexers are required when an external master exists in the system and that external master needs to access the dram. second, using external ad- dress multiplexing causes the clock to address valid timing as slightly accelerated, which may be beneficial in certain high-performance situations. 0 = disable internal address multiplexing for all dram banks. 1 = enable internal address multiplexing for all dram banks. bits 4??eserved 6.13.2 memory controller status register (mstat) the mstat register reports memory controller error information to the user. these bits are set, regardless of whether an internal or external master originated the cycle. bits are reset by writing a one to that bit; writing a zero has no effect. the register may be read at any time and is cleared by reset. no interrupts are generated from this register; however, an internal
system integration module (sim60) 6-70 mc68360 user? manual motorola master may generate a bus error as a result of this register, and for parity errors, the perr pin may be externally connected to an interrupt input. bits 15??eserved wper?rite protect error this bit is asserted when a write protect error occurs. a bus monitor (berr assertion) will (if enabled) prompt the user to read this register if no dsack is provided on a write cycle. the accessed address will be in the berr exception descriptor. wper is cleared by writ- ing one to this bit or by performing a system reset. writing a zero has no effect on wper. perx?arity error these bits indicate that a parity error was detected when reading from bank n. berr is internally asserted if pbee in the gmr is set and if an internal master performs this cycle. the perr signal is continuously asserted until all perx bits are cleared. perx is cleared by writing one or by performing a system reset. writing a zero has no effect on perx. note if external masters of the mc68030-type (including quiccs) are chosen to be asynchronous (configured by clearing the sync bit in the gmr), then they have no parity support. 6.13.3 base register (br) this register is used for both dram and sram banks. most bits are valid for both the dram and sram banks, but some bits are only valid for sram banks. this register is a 32-bit read-write register that may be accessed at any time. v?alid bit this bit indicates that the contents of the br and or pair are valid. the cs /ras signal will not assert until the v-bit is set. 1514131211109876543210 wper per7 per6 per5 per4 per3 per2 per1 per0 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 ba31 ba30 ba29 ba28 ba27 ba26 ba25 ba24 ba23 ba22 ba21 ba20 ba19 ba18 ba17 ba16 0000000000 000000 1514131211109876543210 ba15 ba14 ba13 ba12 ba11 fc3 fc2 fc1 fc0 trlxq back40 csnt40 csntq paren wp v 0000000001 010000
system integration module (sim60) motorola mc68360 user? manual 6-71 note an access to a region that has no v-bit set may cause a bus monitor timeout. 0 = this dram/sram bank is invalid. 1 = this dram/sram bank is valid. note following a system reset, the v-bit is set in br0 if the global chip select is enabled. see the config pins for more details. wp?rite protection this bit can restrict write accesses within the address range of a br. an attempt to write to the range of addresses specified in a br that has this bit set can cause the berr signal to be asserted by the bus monitor logic (if enabled), causing termination of this cycle. 0 = both read and write accesses are allowed. 1 = only read accesses are allowed. the ras /cs signal, ta , and dsack will not be asserted by the quicc on write cycles to this memory bank. wper will be set in the mstat register if a write to this memory bank is attempted. paren?arity checking enable this bit is used to enable checking of parity on either an sram or dram bank. 0 = parity checking is disabled. 1 = parity checking is enabled. note parity checking is not possible for asynchronous external mas- ters. csntq?s negate timing quicc (sram bank only) this bit is used to determine when cs is negated during an internal quicc or external quicc/mc68030-type bus master write cycle. this is helpful to meet address/data hold time requirements for slow memories and peripherals (see figure 6-13 and figure 6-14). 0 = cs is negated normally (as late as possible). 1 = cs is negated one phase earlier, but the cycle length is not affected. note csntq is ignored for an sram cycle by an external master if the sync bit is cleared. csntq = 1 is not valid for external dsack assertion csnt40?s negate timing mc68ec040 (sram bank only) this bit is used to determine when cs is negated during an mc68ec040 write cycle. this is helpful to meet address/data hold time requirements (see figure 6-15). 0 = cs is negated normally (as late as possible). 1 = cs is negated one phase earlier, but the cycle length is not affected.
system integration module (sim60) 6-72 mc68360 user? manual motorola note csnt40 is ignored for an sram cycle by an external master if the sync bit is cleared. csnt40 = 1 is not valid for external dsack assertion back40?urst acknowledge mc68ec040 this bit is used to acknowledge a burst cycle to the mc68040. if set, bursts are enabled in this bank. the quicc generates address lines 2,3 on the baddr3?addr2 pins. 0 = do not acknowledge burst. 1 = acknowledge burst; mc68040 bursts are handled by the memory controller for this bank. trlxq?iming relax this bit delays the beginning of the internal quicc or external quicc/mc68030-type bus master cycle to relax the timing constraints on the user. this attribute is useful for slow peripherals that require additional address setup time. chip selects are delayed by one phase, and the cycle is delayed by one clock. for accesses to dram, ras is delayed by one phase, and cas and amux are delayed by two phases, giving a total cycle increase of one clock. see figures 6-16 and 6-17 for timing diagrams of different cases. 0 = do not relax timing. 1 = relax timing at the beginning of the cycle. one additional clock cycle is added when this bit is set. note trlxq is ignored for an sram cycle by an external master if the sync bit is cleared. to relax the mc68ec040 cycles, use the tss40 bit in the gmr. user should avoid setting both trlxq and csntq = 1, when tcyc = 0. this bit combination will result in a bus cycle without cs assertion. fc3?c0?unction code this field can be used to specify that accesses with the memory bank be limited to a cer- tain address space type. these bits are used in conjunction with the fcm3?cm0 bits in the or. ba31?a11?ase address the base address field, the upper 21 bits of each br, and the function code field are com- pared to the address on the address bus to determine if a dram/sram region is being accessed by an internal quicc master. if the sram/dram region is being accessed by an external master and the we lines are not used, then a31?28 address lines and the ba31?a28 bits are also used in the com- parison. if, however, the sram/dram region is being accessed by an external master
system integration module (sim60) motorola mc68360 user? manual 6-73 and the a31?28 lines are configured as we lines, then the user should write zeros to the ba31?a28 bits so that a31?28 will be masked by the address comparison logic. figure 6-13. csntq = 1 during an internal cycle figure 6-14. csntq = 1 during an external quicc/mc68ec030 cycle figure 6-15. csnt40 = 1 during an external mc68ec040 cycle s4 s5 s0 as (output) cs before cs now clko1 s4 s5 s0 as (input) cs before cs now clko1 c2 c3 c0 ta (output) cs before cs now clko1
system integration module (sim60) 6-74 mc68360 user? manual motorola figure 6-16. trlxq = 1 during an internal cycle figure 6-17. trlxq = 1 during an external quicc/mc68030 cycle 6.13.4 option register (or) this register is used for both dram and sram banks. most bits are valid for both banks, but some bits are only valid for dram banks, and others are only valid for sram banks. this register is a 32-bit read-write register that may be accessed at any time. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 tcyc3 tcyc2 tcyc1 tcyc0 am27 am26 am25 am24 am23 am22 am21 am20 am19 am18 am17 am16 1111000000000000 1514131211109876543210 am15 am14 am13 am12 am11 fcm3 fcm2 fcm1 fcm0 bcyc1 bcyc0 pgme sps1 sps0 dssel 00000000000000/10/10 clko1 address ras cs amux cas dsack s0 s1 s2 s3 trlxq = 1 trlxq = 0 clko1 address as amux cas dsack s1 s2 s3 s4 s5 trlxq = 1 trlxq = 0 s0 ras cs
system integration module (sim60) motorola mc68360 user? manual 6-75 dssel?ynamic ram select this bit determines if the bank is a dram or sram, which impacts a number of signals: 1) the length of the cycle is different; 2) address muxing is performed if gamx = 1; and 3) the previous ras is negated if a page bank miss occurs and dssel = 1 (for the new bank). 0 = sram bank (i.e., sram, eprom, peripherals, etc.) 1 = dram bank sps1?ps0?ram port size (sram bank only) this attribute determines whether a given chip select responds with dsackx and, if so, what port size is returned (see table 6-13). if the cycle is terminated by using the internal wait-state attributes, the quicc drives the dsackx lines according to those bits. if the internal wait-state attributes are not used, the cycle should be terminated with external dsackx . in this case, the quicc does not drive the dsackx lines, but rather samples them at every falling edge of the clock. if an mc68ec040 access is performed using this sram bank and sps= 00, 01, or 10, the sram controller operates in the same way, except it asserts ta instead of dsackx . if sps= 11, ta is sampled at every rising edge of the clock. notes if dsack is provided internally, then the dsackx lines are still sampled externally, and can be asserted externally to end the cycle. however, in this case of external dsackx assertion, ex- ternal dsackx should be asserted and negated prior to when internal dsack would have been asserted by the quicc. this is easily accomplished on the boot chip select since the quicc default value is 14 wait states. the sram controller does not support an external ta response for mc68040 burst mode. also, for non-burst mc68040 cycles, ta cannot be externally asserted before cs is asserted. pgme?age mode enabled (dram banks only) this bit is used to enable page mode accesses to a dram bank. page mode accesses are performed only for an internal quicc or an external quicc/mc68030-type master. 0 = page mode is disabled. 1 = page mode is enabled. table 6-13. sram port size sps1?ps0 result 00 32-bit port size 01 16-bit port size 10 8-bit port size 11 external dsackx response
system integration module (sim60) 6-76 mc68360 user? manual motorola note when the dram controller supports mc68ec040 cycles, pgme must be cleared by the user, or erratic behavior may oc- cur. bit 4?eserved bcyc1?cyc0?urst length cycle in clocks these bits determine the number of wait states inserted in an mc68040 burst cycle. this attribute is for the second, third, and fourth access of the burst cycle. program tcyc3 tcyc0 for the first access. 00 = the burst cycles are 1 clock in length (x,1,1,1). 01 = the burst cycles are 2 clocks in length (x,2,2,2). 10 = the burst cycles are 3 clocks in length (x,3,3,3). 11 = the burst cycles are 4 clocks in length (x,4,4,4). fcm0?cm3?unction code mask this field can be used to mask certain function code bits, allowing more than one address space type to be assigned to a chip select. any set bit causes the corresponding function code pin to be used as part of the address comparison. any cleared bit masks the corre- sponding function code bit. if both supervisor data and program accesses are desired, while ignoring cpu space accesses, then the ncs bit in the gmr should be set. note clear the fcm bits to ignore function codes as part of the ad- dress comparison. regardless of the setting in this register, an external encoding of x111 of the function code pins will be taken as a cpu space ac- cess. am27?m11?ddress mask the address mask field, bits 27?1 of each or, provides for masking any of the corre- sponding bits in the associated br. by masking the address bits independently, external devices of different address range sizes can be used. any cleared bit masks the corre- sponding address bit. any set bit causes the corresponding address bit to be used in the comparison with the address pins. address mask bits can be set or cleared in any order in the field, allowing a resource to reside in more than one area of the address map. this field can be read or written at any time. notes when address lines a31?28 are multiplexed with the we lines, the a31?28 lines are still used in the comparison by an internal quicc master. see the base address bit description in 6.13.3 base register (br).
system integration module (sim60) motorola mc68360 user? manual 6-77 if two chip selects are programmed to assert in the same ad- dress region, only the lower chip select (or ras line) will assert. for example, cs1 has priority over cs4 . tcyc3?cyc0?ycle length in clocks this field determines the length of a bus cycle (see table 6-14). both internal masters and external masters use this field for their accesses to a given memory bank. in addition, an external mc68040 uses this field for the first access of a burst access sequence. although tcyc3?cyc0 is the main parameter for determining cycle length since it se- lects the number of wait states inserted in the cycle, the total cycle length may vary for other reasons, such as a dram page hit, dram page miss, or whether the bus master is internal or external to the quicc. besides tcyc, other bits that can affect the total cy- cle length in certain situations are wbt40, wbtq, dwq, dw40, emws, sync, and tss40 in the gmr, and trlxq, pgme, and bcyc in the or. csntq and csnt40 af- fect the cs timing, but do not affect the total cycle length. if the user has selected an external dsackx or ta response for this memory bank, with the sps or dps bits, then tcyc3?cyc0 are not used. notes external cycles are always three clocks or longer. seetable 6- 11 for more details. normal dram cycles are three clocks when tcyc=0 and four clocks when tcyc=1, etc. therefore fast termination is not pos- sible during the initial access to dram. two clock dram cycles are only possible when page mode is enabled for an internal master. if an external dsack response is selected with either dps in the gmr or sps in the or, tcyc should not be set to zero. table 6-14. cycle length in clocks internal quicc master memory bus cycle length number of clocks number of wait states (sram) number of wait states (dram) tcyc = number comments number comments numbers 02 fast termina- tion * undefined 3 1 3 normal 0 4 24 1 5 35 2 6 46 3 7 57 4 8 68 5 9 15 17 14 18
system integration module (sim60) 6-78 mc68360 user? manual motorola 6.13.5 dram-sram performance summary; table 6-15 lists the performance results possible when setting tcyc = 0, assuming a 25- mhz system clock, 60-ns drams, and 15-ns srams. the items marked with a dash are not applicable to the situation.) notes: 1.for 70-ns drams, items marked with an asterisk should have one additional clock added. 2.for the internal master case, the quicc also supports two-clock accesses with 20-ns srams. table 6-15. maximum dram/sram performance (25 mhz memory move internal master external quicc/ mc68030 type external mc68040 (tss40 = 0) external mc68ec040 (tss40 = 1) sram normal 2 (see note 2) 3 2 3 burst 2, 1, 1,1 3,1,1,1 dram normal 3* 4 3* 4 dram normal back-to- back access 4* 4 4* 5 page hit 2 3 page miss 4* 5 line fill 3*, 2, 2, 2 4,2,2,2
system integration module (sim60) 6-79 mc68360 user? manual motorola
system integration module (sim60) 6-80 mc68360 user? manual motorola
motorola mc68360 user? manual 7-1 section 7 communication processor module (cpm) introduction the cpm includes many blocks that work together to allow an extremely flexible and inte- grated approach to solving many communications problems. the cpm (see figure 7-1) in- cludes the following modules: risc controller four full-duplex serial communication controllers (sccs) support the following pro- tocols: ?eee 802.3/ethernet (optional feature on scc) ?igh-level/synchronous data link control (hdlc/sdlc) ?dlc bus (multidrop bus configuration of hdlc) ?ppletalk (hdlc-based local area network (lan) protocol) ?niversal asynchronous receiver transmitter (uart) ?ynchronous uart (isochronous, 1x clock mode) ?inary synchronous communication (bisync) ?otally transparent operation ?ignaling system #7 (hdlc-based protocol. ram microcode option only) ?profibus (ram microcode option only) ?synchronous hdlc (ram microcode option only) ?ultiple chanel gci (ram microcode option only) ?tm framing (ram microcode option only) ?nhanced ethernet filtering (ram microcode option only) four independent baud rate generators two serial management controllers (smcs) provide additional uart and totally transparent functionality or support the gci channel 0 and 1 monitor and c/i chan- nels in integrated services digital network (isdn) serial interface provides nonmultiplexed serial interface (nmsi) for the four sccs (in- cludes txd, rxd, tclk, rclk, rts , cts , and cd pins) time slot assigner (tsa) supports multiplexing of data from any of the four sccs and two smcs onto two time-division multiplexed (tdm) interfaces. the tsa supports the following tdm formats: ?1/cept lines ?ulse code modulation (pcm) highway interface ?sdn primary rate ?otorola interchip digital link (idl) ?eneral circuit interface (gci), also known as iom-2 ?ser-defined interfaces
introduction 7-2 mc68360 user? manual motorola serial peripheral interface (spi) for synchronous interchip communication fourteen serial direct memory access (sdma) channels support the scc, smcs, and spi two independent direct memory access (idma) channels support external memory and peripherals a command set register supports the risc, idma, sccs, smcs, and spi four general-purpose 16-bit timers or two 32-bit timers internal timers to implement up to 16 additional timers general-purpose parallel port for parallel protocols such as centronics (can also be used as standard parallel i/o) cpm interrupt controller 2.5-kbyte dual-port ram twelve parallel i/o lines with interrupt capability figure 7-1. cpm block diagram note: the term "cp" refers to the nonshaded portion of the cpm. 32-bit risc serial interface time slot assigner internal timer peripheral bus parallel interface port (pip) scc1 scc2 scc3 scc4 smc1 smc2 spi cpm par i/o brg dual-port ram interrupt controller four timers two idmas fourteen sdmas imb
risc controller motorola mc68360 user? manual 7-3 7.1 risc controller the risc controller is the 32-bit central controller of the communication processor module (cpm). since its execution occurs on a separate bus that is hidden from the user, it does not impact cpu32+ core performance. the risc controller works with the serial channels and parallel interface port (pip) to implement the user-chosen protocols and to manage the sdma channels that transfer data between the sccs and memory. the risc controller contains an internal timer that can be used to implement up to 16 additional timers for the user application software. these features are collectively known as the communication pro- cessor (cp), which is a subset of the overall cpm. additionally, the risc controller can manage the operation of the idma channels, if desired. the 32-bit risc handles the lower layer tasks and dma control activities, leaving the 32-bit cpu32+ core (or other external processor) free to handle higher layer activities. thus, the quicc can be thought of as a dual 32-bit processor system. the risc controller communicates with the host (cpu32+ core or other external processor) in several ways. first, many parameters are exchanged through the dual-port ram. in the case of simultaneous accesses (at least one of which is a write operation), the risc con- troller may be delayed by one clock in its access to the dual-port ram. the host is never delayed. second, the risc controller can execute special commands issued by the host. these commands are only required to be issued in special situations. third, the risc con- troller can generate interrupts through the cpm interrupt controller. fourth, status/event reg- isters, which show events that have occurred within the risc, may be read at any time by the cpu32+ or an external processor. the risc controller has the ability to control a set of up to 16 timers. these timers are sep- arate and distinct from the four general-purpose timers and baud rate generators in the cpm. the 16 timers are ideally used in protocols that do not require extreme precision, but in which it is desirable to off-load the host cpu from having to scan the timer tables that are created in software. these timers are clocked from an internal timer used only by the risc controller. the risc controller uses the peripheral bus to communicate with all of its peripherals. each scc has a separate receive and transmit fifo. the scc1 fifos are 32-bytes each; the other scc fifos are 16-bytes each. the smc and spi fifo sizes are double-buffered. the pip is a single register interface. the following priority scheme determines the processing priority of the risc controller. it is as follows: 1. reset in cp command register or system reset 2. dma bus error 3. commands issued to the cp command register 4. cc1 rx 5. scc1 tx 6. scc2 rx 7. scc2 tx
risc controller 7-4 mc68360 user? manual motorola 8. cc3 rx 9. scc3 tx 10. scc4 rx 11. scc4 tx 12. smc1 rx 13. smc1 tx 14. smc2 rx 15. smc2 tx 16. spi rx 17. spi tx 18. pip 19. risc timer tables the risc controller has an option to execute microcode from a portion of user ram, located in the on-chip dual-port ram. in this mode, either 512 bytes or 1024 bytes of the user ram cannot be accessed by the host or another bus master and are used exclusively by the risc. in this mode, the risc controller can fetch instructions from both the dual-port ram and its private rom. this mode allows motorola to add new protocols or enhancements to the quicc in the form of motorola-supplied ram microcodes. the binary microcode is obtained from motorola and then loaded by the user into the dual-port ram. the risc controller contains one configuration register described in the following para- graph. 7.1.1 risc controller configuration register (rccr) the 16-bit, memory-mapped, read-write rccr is used to configure the risc processor and controls the risc internal timer. this register is initialized to zero at reset. bits 0-7 should not be modified unless the user is downloading a motorola-supplied ram microcode pack- age.. time?imer enable this bit enables the risc controller internal timer. the timer will generate a tick to the risc based on the value programmed into the timep bit. time may be modified at any time to start or stop the scanning of the risc timer tables. bit 14?eserved timep?imer period this field controls the risc controller timer tick. the risc timer tables are scanned on each timer tick. the input to this timer tick generator is the general system clock divided by 1024. the formula is (timep + 1) ? 1024 = (general system clock period). thus, a val- 1514131211109876543210 time timep reserved
command set motorola mc68360 user? manual 7-5 ue of 0 stored in these bits gives a timer tick of 1 ? (1024) = 1024 general system clocks. a value of 63 (decimal) stored in these bits gives a timer tick of 64 ? (1024) = 65536 gen- eral system clocks. bits 7-0?eserved - set to zero. 7.1.2 risc microcode revision number the risc controller writes a revision number stored in its rom to a dual-port ram location called rev_num. rev_num is located in the miscellaneous parameter ram. the other locations are reserved for future use. the microcode rivision number only reflect the revision of the micro code. it dose not always refrect the mask number. 7.2 command set the host processor (cpu32+ or other external processor) issues commands to the risc by writing to the command register (cr). the cr only needs to be accessed on rare occasions. for instance, to terminate the transmission of a frame by an scc without waiting until the end of the frame, a stop tx command can be issued to an scc through the command register. the commands are described in general terms in the following paragraphs; they are described in specific terms when the protocol or feature is described in detail. the host should set the flg bit in the cr when it issues commands. the cp clears flg after completing the command to indicate to the host that it is ready for the next command. subsequent commands to the cr may be given only after flg is cleared. the software reset command (issued by setting the rst bit) may be given regardless of the state of flg, but the host should still set flg when setting rst. the cr, a 16-bit, memory-mapped, read-write register, is cleared by reset. rst?oftware reset command this bit is set by the host and cleared by the cp. on execution of this command, the rst bit and the flg bit are cleared within two general system clocks. the risc reset routine is approximately 60 clocks long, but the user can begin initialization of the cp immediately after this command is given. this command is useful when the host wants to reset the reg- isters and parameters for all the channels (sccs, smcs, spi, and pip) as well as the risc processor and risc timer tables. this command does not affect the serial interface (si) or the parallel i/o registers. address name width description misc base + 00 rev_num word microcode revision number misc base + 02 res word reserved misc base + 04 res long reserved misc base + 08 res long reserved 1514131211109876543210 rst opcode ch num flg
command set 7-6 mc68360 user? manual motorola bits 14?2, 3??eserved opcode?peration code the opcodes are listed in table 7-1. notes: 1.stop tx = mc68302 original stop transmit command. 2.gr stop tx = graceful stop transmit command. init tx and rx parameters. this command initializes the transmit and receive pa- rameters in the parameter ram to the values that they had after the last reset of the cp. this command is especially useful when switching protocols on a given serial channel. init rx parameters. this command initializes the receive parameters of the serial channel. init tx parameters. this command initializes the transmit parameters of the serial channel. enter hunt mode. this command causes the receiver to stop receiving and begin looking for a new frame. the exact operation of this command may vary depending on the protocol used. stop tx. this command aborts the transmission from this channel as soon as the trans- mit fifo has been emptied. it should be used in cases where transmission needs to be stopped as quickly as possible. transmission will proceed when the restart command is issued. table 7-1. opcodes opcode scc smc (uart/trans) smc (gci) spi idma timer 0000 init rx & tx params init rx & tx params init rx & tx params init rx & tx params 0001 init rx params init rx params init rx params 0010 init tx params init tx params init tx params 0011 enter hunt mode enter hunt mode 0100 stop tx 1 stop tx 0101 gr stop tx 2 init idma 0110 restart tx restart tx 0111 close rx bd close rx bd close rx bd 1000 set group addr set timer 1001 gci timeout 1010 reset bcs gci abort req 1011 1100 u u u u u u 1101 u u u u u u 1110 u u u u u u 1111 u u u u u u
command set motorola mc68360 user? manual 7-7 graceful stop tx. this command stops the transmission from this channel as soon as the current frame has been fully transmitted from the transmit fifo. transmission will proceed once the restart command is issued and the r-bit is set in the next transmit buffer descriptor. restart tx. when the stop tx command has been issued, this command can be used to restart the transmission at the current buffer descriptor. close rx bd. this command causes the receiver to simply close the current receive buffer descriptor, making the receive buffer immediately available for manipulation by the user. reception continues normally using the next available buffer descriptor. this com- mand may be used to access the data buffer without waiting until the data buffer is com- pletely filled by the scc m set timer. this command activates, deactivates, or reconfigures one of the 16 timers in the risc timer table. set group address. this command sets a bit in the hash table for the ethernet log- ical group address recognition function. gci abort request. the gci receiver sends an abort request on the e-bit. gci timeout. the gci performs the timeout function. reset bcs. this command is used in bisync mode to reset the block check sequence calculation. undefined (u). reserved for use by motorola-supplied ram microcodes. ch num?hannel number these bits are set by the host to define the specific sub-block on which the command is to operate. some sub-blocks share channel number encodings if their commands are mu- tually exclusive. 0000 scc1 0001 0010 0011 0100 scc2 0101 spi/risc timers 0110 0111 1000 scc3 1001 smc1/idma1 1010 1011 1100 scc4 1101 smc2/idma2 1110 1111 flg?ommand semaphore flag the bit is set by the host and cleared by the cp.
dual-port ram 7-8 mc68360 user? manual motorola 0 = the cp is ready to receive a new command. 1 = the cr contains a command that the cp is currently processing. the cp clears this bit at the end of the command execution or after reset. 7.2.1 command register examples to perform a complete reset of the cp, the value $8001 should be written to the cr. fol- lowing this command, the cr will return the value $0000 in two clocks. to execute an enter hunt mode command to scc3, the value $0381 should be written to the cr. while the command is executing, the cr will return the value $0381. when the command has been completely executed, the cr will return the value $0380. 7.2.2 command execution latency the worst-case command execution latency is 120 clocks. the typical command execution latency is about 40 clocks. 7.3 dual-port ram the cpm has 2560 bytes of static ram configured as dual-port memory. the dual-port ram memory map is shown in figure 7-2, and a block diagram is shown in figure 7-3. figure 7-2. dual-port ram memory map 0.5k 1k 1.5k 2k 2.5k 3k 3.5k 4k 0 mbar points to the base bds/data/ucode?12 bytes bds/data/ucode?12 bytes bds/data?12 bytes bds/data/ucode?56 bytes total 2560 bytes parameter ram?68 bytes bds/data in any unused space
dual-port ram motorola mc68360 user? manual 7-9 figure 7-3. dual-port ram block diagram the dual-port ram can be accessed by the risc or one of four bus masters: cpu32+ core, idmas, sdmas, or external bus master. when the dual-port ram is accessed by an exter- nal bus master, cpu32+ core, idma, or sdma channel, it is accessed in three clocks. when the dual-port ram is accessed by the risc, it is accessed in one clock. in the case of simul- taneous access (with at least one write operation), the risc is delayed by one clock. when the dual-port ram is accessed by the cpu32+ core, idmas, sdmas, or external bus master, the data and address are taken from the imb. the data is then presented on the imb data bus. the risc has access to the entire dual-port ram for data fetches and portions of the system ram for microcode instruction fetches. the dual-port ram is used for five possible tasks; any two tasks can occur simultaneously. the first use is to store parameters associated with the sccs, smcs, spi, and idmas in the 768-byte parameter ram. the second use is to store the buffer descriptors that describe where data is to be received and transmitted from. the third use is to store data from the serial channels. this usage is optional since data may also be stored externally in the sys- tem memory. the fourth use is to store ram microcode for the risc processor. this feature allows additional protocols to be added by motorola in the future. the fifth use is for addi- tional scratchpad ram space for the user program. system ram 1792 bytes parmeter ram 768 bytes cp microcode address imb address bus cp microcode data imb data bus 512 bytes 256 bytes 512 bytes 512 bytes address selector peripheral data bus address selector internal peripheral address
dual-port ram 7-10 mc68360 user? manual motorola only the parameters in the parameter ram and the microcode ram option require fixed addresses to be used. the buffer descriptors, buffer data, and scratchpad ram may be located in the internal system ram or in any unused parameter ram (for instance, in the available area when a serial channel or sub-block is not being used). when a microcode from ram is executed, certain portions of the system ram are no longer available. this includes either the first 512-byte block and the last 256-byte block for a small ram microcode, and the first two 512-byte blocks and the last 256-byte block for a large ram microcode. the third 512-byte block is always available as system ram. 7.3.1 buffer descriptors the sccs, smcs, spi always use buffer descriptors for controlling data buffers. the buffer descriptor format of the sccs, smcs, and spi is identical. the buffer descriptor format for these channels is shown in the following illustration. if the idma is used in the buffer chaining or auto buffer mode, the idma channel also uses buffer descriptors. the buffer descriptors for the idma are described in 7.6.1 idma key fea- tures;. 7.3.2 parameter ram the cp maintains a section of dual-port ram called the parameter ram. this ram contains many parameters for the operation of the sccs, smcs, spi, and the idma channels. an overview of the parameter ram structure is shown in figure 7-4. the exact definition of the parameter ram is contained in each subsection describing a device that uses a parameter ram. 150 offset + 0 status and control offset + 2 data length offset + 4 high-order data buffer pointer offset + 6 low-order data buffer pointer
risc timer tables motorola mc68360 user? manual 7-11 figure 7-4. parameter ram overview 7.4 risc timer tables the risc controller has the ability to control up to 16 timers. these timers are separate from the four general-purpose timers and baud rate generators in the cpm. the 16 timers are ideally used in protocols that do not require extreme precision, but in which it is desirable to off-load the host cpu from having to scan the timer tables that are created in software. these timers are clocked from an internal timer used only by the risc. the features of the risc timer tables are as follows: up to 16 timers supported two timer modes: one-shot and restart maskable interrupt on timer expiration programmable timer resolution as low as 41 m s at 25 mhz maximum timeout period of 172 sec at 25 mhz scc1/misc 192 bytes scc2/spi 256 bytes/page total 768 bytes 3k 4k scc3/smc1/idma1 192 bytes scc4/smc2/idma2 192 bytes 192 bytes
risc timer tables 7-12 mc68360 user? manual motorola continuously updated reference counter all operations on the risc timer tables are based on a fundamental "tick" of the risc inter- nal timer, which is programmed in the risc rccr. the tick is a multiple of 1024 general system clocks. (see 7.1 risc controller for more details.) the risc timer tables have the lowest priority of all risc operations. therefore, if the risc is so busy with other tasks that it does not have time to service the timer during a tick interval, one or more of the timers may not be updated during a tick. this behavior can actually be used to estimate the worst-case loading of the risc proces- sor. (see table 7-2 for more details.) the risc timer tables are configured in the rccr, the risc timer table parameter ram, and by the set timer command issued to the cp command register, the risc timer event register, and the risc timer mask register. 7.4.1 risc timer table parameter ram two areas of internal ram are used for the risc timer tables: the risc timer table param- eter ram and risc timer table entries (see figure 7-5). the risc timer table parameter ram area begins at the risc timer base address (see table 7-2). this area is used for the general timer parameters. figure 7-5. risc timer table ram usage always the same location in parameter ram risc timer table parameter ram (14 bytes) 16 risc timer table entries (up to 64 bytes) can be anywhere in the dual-port ram pointer internal dual-port ram tm_base
risc timer tables motorola mc68360 user? manual 7-13 note: boldfaced items are initialized by the user. tm_base. the actual risc timers are located by the user as a small block of memory in the dual-port ram. tm_base is the offset from the beginning of dual-port ram where that block resides. the user should allocate 4 bytes at tm_base for each timer used (64 bytes at tm_base if all 16 timers are used). if less than 16 timers are used, the timers should always be allocated in ascending order (risc timer 0, risc timer 1, etc.) to save space. for example, if the user only needs two timers, then 8 bytes are required at location tm_base as long as the user only enables risc timer 0 and risc timer 1. note tm_base should always be aligned to a long-word boundary (i.e., evenly divisible by 4). tm_ptr. this value is used exclusively by the risc to point to the next timer to be accessed in the timer table. it should not be modified by the user. r_tmr. this value is used exclusively by the risc to store the mode of the timer: one-shot (bit is zero) or restart (bit is one). r_tmr should not be modified by the user. the set timer command should be used instead. r_tmv. this value is used exclusively by the risc to store whether a timer is currently enabled. a bit is a one if the corresponding timer is enabled. r_tmv should not be modified by the user. the set timer command should be used instead. tm_cmd. this value is used as a parameter location when the set timer command is issued. the user should write this location prior to issuing the set timer command. this parameter is defined as follows: v?alid this bit should be set to enable the timer and cleared to disable the timer. r?estart this bit should be set for an automatic restart or cleared for a one-shot operation of the timer. table 7-2. risc timer table parameter ram address name width description timer base + 00 tm_base word risc timer table base address timer base + 02 tm_ptr word risc timer table pointer timer base + 04 r_tmr word risc timer mode register timer base + 06 r_tmv word risc timer valid register timer base + 08 tm_cmd long risc timer command register timer base + 0c tm_cnt long risc timer internal count 31 30 29 20 19 16 15 0 v r timer number timer period (16 bits)
risc timer tables 7-14 mc68360 user? manual motorola bits 29?0?eserved these bits should be written with zeros. bits 19?6?imer number the timer number is a value from 0 to 15 that signifies the timer is configured. bits 15??imer period the timer period is the 16-bit timeout value of the timer. the maximum value is 65536, which is programmed by writing $0000 to the timer period. tm_cnt. this value is simply a tick counter that is updated by the risc after each tick. it is updated if the risc internal timer is enabled, regardless of whether any of the 16 timers are enabled. it can be used to track the number of ticks that the risc has received and responded to. this value is updated only after the risc scans the timer table. 7.4.2 risc timer table entries the actual 16 timers themselves are located in the block of memory following the tm_base location. each timer occupies 4 bytes. the first word forms the initial value of the timer writ- ten during the execution of the set timer command, and the next word is the current value of the timer, which is decremented until it reaches zero. these locations should not be mod- ified by the user; they are documented only as a debugging aid for user code. 7.4.3 risc timer event register (rter) this 16-bit register is used to report events recognized by the 16 timers and to generate interrupts. bit 0 corresponds to timer 0, and bit 15 corresponds to timer 15. note that an interrupt will only be generated if the risc timer table bit is set in the cpm interrupt mask register. rter may be read at any time. a bit is cleared by writing a one (writing a zero does not affect a bit? value), and more than one bit may be cleared at a time. this register is cleared at reset. 7.4.4 risc timer mask register (rtmr) this 16-bit register is used to enable interrupts that may be generated in the risc timer event register. if a bit is set, it enables the corresponding interrupt in the rter. if a bit is cleared, it masks the corresponding interrupt in the rter. note that an interrupt will only be generated if the risc timer table bit is set in the cpm interrupt mask register. this read- write register is cleared at reset. 7.4.5 set timer command this command is used to enable, disable, and configure the 16 timers in the risc timer ta- ble. the set timer command is issued to the cr. this means the value $ 0851 should be written to cr. however, before writing this value, the tm_cmd value should be set up by the user. see 7.4.1 risc timer table parameter ram for details. 7.4.6 risc timer initialization sequence the following sequence initializes the risc timers: 1. configure the rccr to determine the desired tick interval that will be used for the en-
risc timer tables motorola mc68360 user? manual 7-15 tire timer table. the time bit would normally be turned on at this time; however, it can be turned on later if it is required that all risc timers be synchronized. 2. determine the maximum number of timers to be located in the timer table and config- ure tm_base in the risc timer table parameter ram to point to a location in the dual port ram with 4 ? n bytes available, where n is the number of timers. if n is less than 16, use timer 0 through timer n? (for space efficiency). 3. clear the tm_cnt in the risc timer table parameter ram to show how many ticks have elapsed since the risc internal timer was enabled. this step is optional. 4. clear the risc timer event register if it is not already cleared. (ones are written to clear this register.) 5. configure the rtmr to enable those timers that should generate interrupts. (ones en- able interrupts.) 6. set the risc timer table bit in the cpm interrupt mask register to generate interrupts to the system. (the cpm interrupt controller may require other initialization not men- tioned here.) 7. configure the tm_cmd field of the risc timer table parameter ram. at this point, de- termine whether a timer is to be enabled or disabled, one-shot or restart, and what its timeout period should be. if the timer is being disabled, the parameters (other than the timer number) are ignored. 8. issue the set timer command by writing $0861 to the cr. 9. repeat the preceding two steps for each timer to be enabled or disabled. 7.4.7 risc timer initialization example the following sequence initializes risc timer 0 to generate an interrupt approximately every second using a 25-mhz general system clock: 1. write the timep bits of the rccr with 111111 to generate the slowest clock. this val- ue will generate a tick every 65536 clocks, which is every 2.6 ms at 25 mhz. 2. configure tm_base in the risc timer table parameter ram to point to a location in the dual-port ram with 4 bytes available. assuming the beginning of dual-port ram is available, write $0000 to tm_base. 3. write $0000 to tm_cnt in the risc timer table parameter ram to see how many ticks have elapsed since the risc internal timer was enabled. this step is optional. 4. write $ffff to the rter to clear any previous events. 5. write $0001 to the rtmr to enable risc timer 0 to generate an interrupt. 6. write $00020000 to the cpm interrupt mask register to allow the risc timers to gen- erate a system interrupt. initialize the cpm interrupt configuration register. 7. write $c0000ee6 to the tm_cmd field of the risc timer table parameter ram. this enables risc timer 0 to time out after 3814 (decimal) ticks of the timer. the timer will automatically restart after it times out. 8. write $0851 to the cr to issue the set timer command. 9. set the time bit in the rccr to enable the risc timer to begin operation.
risc timer tables 7-16 mc68360 user? manual motorola 7.4.8 risc timer interrupt handling the following sequence describes what would normally occur within an interrupt handler for the risc timer tables: 1. once an interrupt occurs, read the risc timer event register to see which timer or tim- ers have caused interrupts. the risc timer event bits would normally be cleared at this time. 2. issue additional set timer commands at this time or later, as desired. nothing need be done if the timer is being restarted automatically for a repetitive interrupt. 3. clear the r-tt bit in the cpm interrupt status register. 4. execute the rte instruction. 7.4.9 risc timer table algorithm the risc scans the timer table once every tick. for each valid timer in the timer table, the risc decrements the count and checks for a timeout. if no timeout occurs, it moves to the next timer. if a timeout occurs, the risc sets the corresponding event bit in the risc timer event register. it checks to see if the timer is to be restarted. if so, it leaves the timer valid bit set in the r_tmv location and resets the current count to the initial count; otherwise, it clears the r_tmv bit. once the timer table is scanned, the risc updates the tm_cnt value in the risc timer table parameter ram and ceases working on the timer tables until the next tick. if a set timer command is issued, the risc controller makes the appropriate modifica- tions to the timer table and parameter ram, but does not scan the timer table until the next tick of the internal timer. it is important to use the set timer command to properly synchro- nize the timer table alterations to the execution of the risc. 7.4.10 risc timer table application: track the risc loading the risc timers can be used to track the loading of the risc controller. the following sequence gives a method for using the 16 risc timers to determine if the risc controller ever exceeds the 96% utilization level during any tick interval. removing the timers then adds a 4% margin to the risc utilization level. the aggressive user can use this technique to push the risc performance to its limit in an application. the user should use the standard initialization sequence, with the following differences: 1. program the tick of the risc timers to be 1024 x 16 = 16384. 2. disable risc timer interrupts, if desired. 3. using the set timer command, initialize all 16 risc timers to have a timer period of $0000, which equates to 65536. 4. program one of the four general-purpose timers to increment once every tick. the gen- eral-purpose timer should be free-running and should have a timeout of 65536. 5. after hours of operation, compare the general-purpose timer to the current count of risc timer 15. if risc timer 15 is more than two ticks different from the general-pur- pose timer, the risc controller has, during some tick interval, exceeded the 96% uti-
timers motorola mc68360 user? manual 7-17 lization level. note the general-purpose timers are up-counters, but the risc tim- ers are down-counters. the user should consider this fact when comparing timer counts. 7.5 timers the cpm includes four identical, 16-bit, general-purpose timers or two 32-bit timers. each general-purpose timer consists of a timer mode register (tmr), a timer capture register (tcr), a timer counter (tcn), a timer reference register (trr), and a timer event register (ter). the tmr contains the prescaler value programmed by the user. in addition, there is one timer global configuration register (tgcr). the timer block diagram is shown in figure 7-6. figure 7-6. timer block diagram 7.5.1 timer key features the four identical general-purpose timers have the following features: maximum period of 10.7 sec (at 25 mhz) 40-ns resolution (at 25 mhz) programmable sources for the clock input timer clock generator capture detection event register mode register mode bits prescaler timer counter capture register reference register divider clock ter1 tmr1 tcn1 trr1 tcr1 tin1 tout1 timer1 timer2 timer3 timer4 global configuration register tgate1 tgate2 tgcr tin2 tin3 tin4 tout2 tout3 tout4 general system clock
timers 7-18 mc68360 user? manual motorola input capture capability output compare with programmable mode for the output pin two timers internally or externally cascadable to form a 32-bit timer free run and restart modes functionally compatible with timer 1 and timer 2 on the mc68302 7.5.2 general-purpose timer units the clock input to the prescaler may be selected from three sources: the general system clock, the general system clock divided by 16, or the corresponding tinx pin. each option is discussed in the following paragraphs. the general system clock is generated in the clock synthesizer and defaults to the system frequency (for instance, 25 mhz). however, the general system clock has the option to be divided before it leaves the clock synthesizer. this mode, called slow go, is used to save power. whatever the resulting frequency of the general system clock, the user may choose either that frequency or that frequency divided by 16 as the input to the prescaler of each timer. alternatively, the user may choose the tinx pin to be the clock source. tinx is internally syn- chronized to the internal clock. if the user has chosen to internally cascade two 16-bit timers to a 32-bit timer, then a timer may internally use the clock generated by the output of another timer. the clock input source is selected by the iclk bits of the corresponding tmr. the prescaler is programmed to divide the clock input by values from 1 to 256. the output of the prescaler is used as an input to the 16-bit counter. the best resolution of the timer is one clock cycle (40 ns at 25 mhz). the maximum period (when the reference value is all ones) is 268,435,456 cycles (10.7 sec at 25 mhz). both val- ues assume that the general system clock is the full 25 mhz. each timer may be configured to count until a reference is reached and then either begin a new time count immediately or continue to run. the frr bit of the corresponding tmr selects each mode. upon reaching the reference value, the corresponding ter bit is set, and an interrupt is issued if the ori bit in the tmr is set. each timer may output a signal on the timer output pin (tout1 , tout2 , tout3 , or tout4 ) when the reference value is reached (selected by the om bit of the corresponding tmr). this signal can be an active-low pulse or a toggle of the current output. the output can also be internally connected to the input of another timer, resulting in a 32-bit timer. each timer has a 16-bit tcr, which is used to latch the value of the counter when a defined transition of tin1, tin2, tin3, or tin4 is sensed by the corresponding input capture edge detector. the type of transition triggering the capture is selected by the ce bits in the corre- sponding tmr. upon a capture or reference event, the corresponding ter bit is set, and a maskable interrupt request is issued to the cpm interrupt controller.
timers motorola mc68360 user? manual 7-19 the timers may be gated/restarted by an external gate signal. there are two gate pins: tgate1 controls timer 1 and/or timer 2; tgate2 controls timer 3 and/or timer 4. normal gate mode enables the count on a falling edge of the tgatex pin and disables the count on the rising edge of the tgatex pin. normal gate mode allows the timer to count conditionally based on the state of the tgatex pin. restart gate mode performs the same function as normal mode, except that it also resets the counter on the falling edge of the tgatex pin. the restart gate mode has applications in pulse interval measurement and bus monitoring: pulse measurement?he restart gate mode can measure a low pulse on the tgatex pin. the rising edge of the tgatex pin completes the measurement, and if tgatex is externally connected to tinx, causes the timer to capture the count value and generate a rising-edge interrupt. bus monitoring?he restart gate mode can detect a signal that is abnormally stuck low. the bus signal should be connected to the tgatex pin. the timer count is reset on the falling edge of the bus signal, and if the bus signal does not go high again within the number of user-defined clocks, an interrupt can be generated. the gate function is enabled in the tmr, and the gate operating mode is selected in the tgcr. note: tgate is internally synchronized to the system clock. if tgate meets the asynchronous input setup time (spec #47a) then, when working with the internal clock, the counter will begin counting after 1 system clock. 7.5.2.1 cascaded mode. in this mode (see figure 7-7) two 16-bit timers can be inter- nally cascaded to form a 32-bit counter. timer 1 may be internally cascaded to timer 2, and timer 3 may be internally cascaded to timer 4. since, the decision to cascade timers is made independently, the user may select such options as two 16-bit timers and one 32-bit timer. the tgcr is used to put the timers into cascaded mode. figure 7-7. timer cascaded mode block diagram if the cas bit is set in the tgcr, the two timers function as a one 32-bit timer with one 32- bit trr, one 32-bit tcr, and one 32-bit tcn. in this case, tmr1 and/or tmr3 are ignored, and the modes are defined using tmr2 and/or tmr4. the capture will be controlled from tin2 or tin4. interrupts will be generated from ter2 or ter4. timer1 timer2 timer3 timer4 capture capture clock trr, tcr, tcn connected to data bus pins 15? clock trr, tcr, tcn connected to data bus pins 15? trr, tcr, tcn connected to data bus pins 31?6 trr, tcr, tcn connected to data bus pins 31?6
timers 7-20 mc68360 user? manual motorola when working in the cascaded mode, the cascaded trr, tcr, and tcn should always be referenced with 32-bit bus cycles. 7.5.2.2 timer global configuration register (tgcr). the tgcr is a 16-bit, memory-mapped, read/write register that contains configuration parameters used by all four timers. it allows starting and stopping any number of timers simultaneously if one bus cycle is used to access tgcr. the tgcr is cleared by reset. cas4?ascade timers 0 = normal operation. 1 = timers 3 and 4 are cascaded to form a 32-bit timer. cas2?ascade timers 0 = normal operation. 1 = timers 1 and 2 are cascaded to form a 32-bit timer. frz?reeze 0 = the corresponding timer ignores the freeze pin. 1 = halt the corresponding timer if the freeze pin is asserted. (the freeze pin is asserted in background debug mode when the cpu32+ is enabled.) stp ?top timer 0 = normal operation. 1 = reduce power consumption of the timer. this bit stops all clocks to the timer, ex- cept the clock from the imb interface, which allows the user to read and write timer registers. the clocks to the timer remain stopped until the user clears this bit or a hardware reset occurs. rst?eset timer 0 = reset the corresponding timer (a software reset is identical to an external reset). 1 = enable the corresponding timer if the stp bit is cleared. gm2?ate mode for pin 2 this bit is only valid if the gate function is enabled in tmr3 or tmr4. 0 = restart gate mode. the tgate2 pin is used to enable/disable the count. the fall- ing edge of tgate2 enables and restarts the count, and the rising edge of tgate2 disables the count. 1 = normal gate mode. this mode is the same as 0, except the falling edge of tgate2 does not restart the count value in tcn. 1514131211109876543210 cas4 frz4 stp4 rst4 gm2 frz3 stp3 rst3 cas2 frz2 stp2 rst2 gm1 frz1 stp1 rst1
timers motorola mc68360 user? manual 7-21 gm1?ate mode for pin 1 this bit is only valid if the gate function is enabled in tmr1 or tmr2. 0 = restart gate mode. the tgate1 pin is used to enable/disable count. a falling tgate1 pin enables and restarts the count, and a rising edge of tgate1 disables the count. 1 = normal gate mode. this mode is the same as 0, except the falling edge of tgate1 does not restart the count value in tcn. 7.5.2.3 timer mode register (tmr1, tmr2, tmr3, tmr4). tmr1?mr4 are identi- cal 16-bit, memory-mapped, read/write registers. these registers are cleared by reset. note the tgcr should be initialized prior to the tmrs, or erratic be- havior may occur. the only exception is the rst bit in the tgcr, which may be modified at any time. ps?rescaler value the prescaler is programmed to divide the clock input by values from 1 to 256. the value 00000000 divides the clock by 1; the value 11111111 divides the clock by 256. ce?apture edge and enable interrupt 00 = disable interrupt on capture event; capture function is disabled. 01 = capture on rising tinx edge only and enable interrupt on capture event. 10 = capture on falling tinx edge only and enable interrupt on capture event. 11 = capture on any tinx edge and enable interrupt on capture event. om?utput mode 0 = active-low pulse on toutx for one timer input clock cycle as defined by the iclk bits. thus, toutx may be low for one general system clock period, one general system clock/16 period, or one tinx pin clock cycle period. toutx changes occur on the rising edge of the system clock. 1 = toggle the toutx pin. toutx changes occur on the rising edge of the system clock. ori?utput reference interrupt enable 0 = disable interrupt for reference reached (does not affect interrupt on capture func- tion). 1 = enable interrupt upon reaching the reference value. frr?ree run/restart 0 = free run. the timer count continues to increment after the reference value is reached. 1 = restart. the timer count is reset immediately after the reference value is reached. 1514131211109876543210 ps ce om ori frr iclk ge
timers 7-22 mc68360 user? manual motorola iclk?nput clock source for the timer 00 = internally cascaded input. for tmr1, the timer 1 input is the output of timer 2. for tmr3, the timer 3 input is the output of timer 4. for tmr2 and tmr4, this selection means no input clock is provided to the timer. 01 = internal general system clock. 10 = internal general system clock divided by 16. 11 = corresponding tin pin: tin1, tin2, tin3, or tin4 (falling edge). ge?ate enable 0 = the tgate signal is ignored. 1 = the tgate signal is used to control the timer. 7.5.2.4 timer reference registers (trr1, trr2, trr3, trr4). each trr is a 16-bit, memory-mapped, read-write register containing the reference value for the timeout. trr1?rr4 are set to all ones by reset. the reference value is not reached until tcn incre- ments to equal trr. 7.5.2.5 timer capture registers (tcr1, tcr2, tcr3, tcr4). each tcr is a 16- bit register used to latch the value of the counter. tcr1?cr4 appear as memory- mapped, read-only registers to the user. tcr1?cr4 are cleared by reset. 7.5.2.6 timer counter (tcn1, tcn2, tcn3, tcn4). each tcn is a 16-bit, memory- mapped, read-write up-counter. a read cycle to tcn1?cn4 yields the current value of the timer, but does not affect the counting operation. a write cycle to tcn1?cn4 sets the reg- ister to the written value, causing its corresponding prescaler to be reset. note write operation to this register while the timer is not running may not update the register correctry. user should always use timer refrence register to define desired count value. 7.5.2.7 timer event registers (ter1, ter2, ter3, ter4). each ter is a 16-bit register used to report events recognized by any of the timers. on recognition of an output reference event, the timer sets the ref bit in the ter, regardless of the corresponding ori in the tmr. the capture event will be set only if enabled by the ce bits in the tmr. ter1 ter4, which appear to the user as memory-mapped registers, may be read at any time. a bit is reset by writing a one to that bit (writing a zero does not affect a bit? value). more than one bit may be reset at a time. both bits must be reset before the timer will negate the interrupt to the cpm interrupt controller. this register is cleared by reset. bits 15??eserved 1514131211109876543210 ref cap
timers motorola mc68360 user? manual 7-23 ref?utput reference event the counter has reached the trr value. the ori bit in the tmr is used to enable the interrupt request caused by this event. cap?apture event the counter value has been latched into the tcr. the ce bits in the tmr are used to enable generation of this event. 7.5.3 timer examples the following example lists the required initialization sequence of timer 2 to generate an in- terrupt every 10 m s, assuming a general system clock of 25 mhz. this means that an inter- rupt should be generated every 250 system clocks. 1. tgcr = $0000. put timer 2 into the reset state. do not use cascaded mode. 2. tmr2 = $001a. enable the prescaler of the timer to divide-by-1 and the clock source to general system clock. enable an interrupt when the reference value is reached, and restart the timer to repeatedly generate 10- m s interrupts. 3. tcn2 = $0000. initialize the timer 2 count to zero. this is the default state of this reg- ister. 4. trr2 = $00fa. initialize the timer 2 reference value to 250 (decimal). 5. ter2 = $ffff. clear ter2 of any bits that might have been set. 6. cimr = $00040000. enable the timer 2 interrupt in the cpm interrupt controller. initial- ize the cpm interrupt configuration register. 7. tgcr = $0010. enable timer 2 to begin counting. to implement the same function with a 32-bit timer using timer 1 and timer 2, the following sequence may be used: 1. tgcr = $0080. cascade timer 1 and timer 2. put timer 1 and timer 2 in the reset state. 2. tmr2 = $001a. enable the prescaler of timer 2 to divide-by-1 and the clock source to general system clock. enable an interrupt when the reference value is reached, and restart the timer to repeatedly generate 10 m s interrupts. 3. tmr1 = $0000. enable timer 1 to use the output of timer 2 as its input, which is the default state of this register. 4. tcn1 = $0000, tcn2 = $0000. initialize the combined timer 1 and timer 2 count to zero which is the default state of this register. (this can be accomplished with one 32- bit data move to tcn1.) 5. trr1 = $0000, trr2 = $00fa. initialize the combined timer 1 and timer 2 reference value to 250 (decimal). (this can be accomplished with one 32-bit data move to trr1.) 6. ter2 = $ffff. clear ter2 of any bits that might have been set. 7. cimr = $00040000. enable the timer 2 interrupt in the cpm interrupt controller. initial- ize the cpm interrupt configuration register. 8. tgcr = $0091. enable timer 1 and timer 2 to begin counting. leave the timers in cas-
idma channels 7-24 mc68360 user? manual motorola caded mode. 7.6 idma channels the quicc includes a number of dma channels, including 14 sdma channels for the four sccs, two smcs, and spi and two general-purpose idma controllers. the sdma channels are discussed in 7.7 sdma channels. the idma channels are discussed in the following paragraphs. the two general-purpose idma controllers can operate in different modes of data transfer as programmed by the user. the idma can transfer data between any combination of mem- ory and i/o. in addition, data may be transferred in either byte, word, or long-word quantities, and the source and destination addresses may be either odd or even. the most efficient packing algorithms are used in the idma transfers. the single address mode gives the high- est performance, allowing data to be transferred between memory and a peripheral in a sin- gle bus cycle. the chip-select and wait-state generation logic on the quicc may be used with the idma. the idma supports three buffer handling modes: single buffer, auto buffer, and buffer chain- ing. single buffer mode is that of the traditional dma controller. the auto buffer mode allows blocks of data to be repeatedly moved from one location to another without user interven- tion. the buffer chaining mode allows a chain of blocks to be moved. the user specifies the data movement using buffer descriptors that are similar to those used by an scc. these buffer descriptions reside in the dual-port ram. if the single buffer mode of the idma is used, programming the idma is very similar (although not exactly software compatible) to that of the idma on the mc68302 or the dma controller on the mc68340. the auto buffer and buffer chaining modes, however, are not available on those devices, and the single address mode is not available on the mc68302. the maximum transfer rate of the idma is 50 mbyte/sec. this assumes a 32-bit data transfer from memory to peripheral using fast termination (2 clocks per bus cycle) timing and single address mode: (4 bytes 25 mhz clocks/sec)/(2 clocks per transfer) = 50 mbyte/sec. the maximum transfer rate of the idma in dual address mode is 25 mbyte/sec. this assumes a 32-bit source and destination, fast termination (2 clocks per bus cycle) timing, and two bus cycles for each transfer: (4 bytes 25 mhz clocks/sec)/(4 clocks per transfer) = 25 mbyte/sec. the idma controller block diagram is shown in figure 7-8.
idma channels motorola mc68360 user? manual 7-25 figure 7-8. idma controller block diagram 7.6.1 idma key features; the idma contains the following features: two independent, fully programmable dma channels dual address or single address transfers with 32-bit address and 32-bit data capa- bility dma control machine idma requests (dreqx pins) bus control bus arbitration channel configuration register the risc can clear the str bit fcr iccr cmr cmar csr sapr dapr bcr dhr risc controller access imb source address pointer register destination address pointer register byte count register channel status register channel mode register data holding register channel mask register function code register
idma channels 7-26 mc68360 user? manual motorola up to 50 mbyte/sec transfer rates in single address mode and 25 mbyte/sec in dual address mode (assuming a 25-mhz system clock) 32-bit byte transfer counters 32-bit address pointers that can increment or remain constant operand packing and unpacking for dual address transfers using the most efficient techniques supports all bus-termination modes provides full dma handshake for cycle steal and burst transfers supports fixed and rotating priority between idma channels buffer handling modes: single buffer, auto buffer, and buffer chaining 7.6.2 idma registers each idma channel has eight registers that define its specific operation. these registers include a 32-bit source address pointer register (sapr), a 32-bit destination address pointer register (dapr), an 8-bit function code register (fcr), a 32-bit byte count register (bcr), a 16-bit channel mode register (cmr), an 16-bit channel configuration register (iccr), an 8- bit channel status register (csr), and an 8-bit channel mask register (cmar). these regis- ters provide the addresses, transfer count, and configuration information necessary to set up a transfer. they also provide a means of controlling the idma channel and monitoring its status. all registers can be modified by the cpu32+ core. for the auto buffer and buffer chaining modes, the risc controller uses a buffer descriptor ring to automatically initialize the dapr, sapr, and bcr. the buffer descriptor ring resides in dual-port ram so that it may be accessed by the risc controller without bus overhead. the idma channel also includes a 32-bit data holding register (dhr), which is not accessi- ble to the cpu32+ core and is used by the idma for temporary data storage. 7.6.2.1 idma channel configuration register (iccr). the 16-bit iccr config- ures both idma channels. it is always readable and writable in the supervisor mode, although writing is not recommended unless the module is disabled. it is initialized to $0000 at reset. stp?top bit 0 = the system clock operates normally within the idma. 1 = stop the system clock to the idma channels. this setting is used to conserve pow- er when both idmas are unused. 1514131211109876543210 stp frz arbp ism iaid
idma channels motorola mc68360 user? manual 7-27 frz1?rz0?reeze these bits determine the action to be taken when the freeze signal is asserted. the idma negates its internal bus request and keeps it negated until freeze is negated or the idma is reset. 00 = the idma channels ignore the freeze signal. 01 = reserved. 10 = the idma channels freeze on the next bus cycle. 11 = reserved. arbp?rbitration priority these two bits select the arbitration priority between the two idma channels. 00 = idma channel 1 has priority over channel 2. 01 = idma channel 2 has priority over channel 1. 10 = rotating priority. 11 = reserved. ism?nterrupt service mask these bits contain the interrupt service mask. when the interrupt service level on the imb is greater than the interrupt service mask, the idma vacates the bus and negates its bus request to the imb until the interrupt level service is less than or equal to the interrupt ser- vice mask. note the user should program ism to 7 for typical user applications. this gives the idma priority over all interrupt handlers. these bits must be set to 7 if the quicc is in slave mode. bits 7, 3??eserved iaid?dma arbitration id these bits establish bus arbitration priority level among sub-blocks that have the capabil- ity of becoming bus master. in the quicc, the idmas, the sdmas, and the sim60 dram refresh controller can become bus masters. an arbitration id uses a number (0?) to de- cide the priority of multiple bus masters that are requesting the imb. a 0 is the lowest pri- ority and a 7 is the highest priority. the value programmed into the iaid bits is the arbitration id of the highest priority idma channel. the arbitration id of the lowest priority idma channel is iaid minus 2. the arbp bits determine which idma channel has the higher priority. if round-robin priority is select- ed, then the idma channels alternate between the two iaid values. example: if arbp = 00, selecting idma channel 1 to always have the highest priority, the iaid values are: idma channel 1 arbitration id = iaid idma channel 2 arbitration id = iaid ?2 notes the user should program iaid to 2 in typical user applications. iaid should not be programmed to a value less than 2. this val-
idma channels 7-28 mc68360 user? manual motorola ue should be less than the sdma arbitration id so that the sdma channels have priority over the idma channels. user must program this field to 7 when the quicc is configured in slave mode. 7.6.2.2 channel mode register (cmr). each idma channel contains a 16-bit cmr that is reset to $0000. it is used to configure most of the idma options. eco ?external control option dual address mode : this bit defines which device is connected to the control signals. 0 = the control signals (dreqx , dackx , and donex ) are associated with the desti- nation (write) portion of the transfer. 1 = the control signals (dreqx , dackx , and donex ) are associated with the source (read) portion of the transfer. single address mode : this bit defines the direction of the transfer. 0 = the device writes to memory, and the control signals (dreqx , dackx , and don- ex ) are used by the device to provide data during the destination (write) portion of the transfer. 1 = the device reads from memory, and the control signals (dreqx , dackx , and donex ) are used by the device to write data during the source (read) portion of the transfer. note if reqg is programmed to be internal (reqg = 0x), dreqx is ignored. srm ?synchronous request mode this bit controls how external devices may use the dreqx pin for idma service. this bit is only relevant for applications that use external request mode or use the external donex pin to terminate the idma operation. 0 = asynchronous request mode is selected. the dreqx and donex input signals are internally synchronized to the idma clock before they are used by the idma. 1 = synchronous request mode is selected. the dreqx and donex input signals are used by the idma without first being internally synchronized. this results in faster operation, but should only be used if setup and hold times can be met. s/d ?single/dual address transfer 0 = the idma channel runs standard dual address transfers. each transfer requires at least two bus cycles. data packing is performed using the dhr. 1 = the idma channel runs single address transfers from a peripheral to memory or from memory to a peripheral. the transfer requires one bus cycle. the dhr is not used for these transfers because the data is transferred directly into the destination location. 1514131211109876543210 eco srm s/d rci reqg sapi dapi ssize dsize bt rst str
idma channels motorola mc68360 user? manual 7-29 rci ?risc controls idma 0 = single buffer mode. the user programs all idma registers for each buffer transfer. 1 = auto buffer or buffer chaining mode. the risc reconfigures the idma channel at the end of each buffer transfer according to the buffer descriptor ring. the choice between auto buffer and buffer chaining is made in the buffer descriptor itself. reqg ?request generation the reqg bits define what generates the requests for idma activity over the bus. 00 = internal request at limited rate (limited burst bandwidth) set by bt bits 01 = internal request at maximum rate (one burst) 10 = external request burst transfer mode (dreqx is level sensitive) 11 = external request cycle steal (dreqx is edge sensitive) sapi ?sapr increment 0 = sapr is not incremented after each transfer. 1 = sapr is incremented by one, two, or four after each transfer, according to the ssize bits. (sapr may be incremented by an amount less than the ssize value at the beginning or end of a block transfer, depending on the source starting ad- dress or byte count.) dapi ?dapr increment 0 = dapr is not incremented after each transfer. 1 = dapr is incremented by one, two, or four after each transfer, according to the dsize bits. (dapr may be incremented by an amount less than the dsize value at the beginning or end of a block transfer, depending on the destination starting address or byte count.) ssize ?source size the following decoding shows the definitions for the ssize bits. the user should set these bits to the port size of the source (e.g., choose byte for an 8-bit peripheral). 00 = long word 01 = byte 10 = word 11 = reserved dsize ?destination size the following decoding shows the definitions for the dsize bits. the user should set these bits to the port size of the destination (e.g., choose byte for an 8-bit peripheral). 00 = long word 01 = byte 10 = word 11 = reserved
idma channels 7-30 mc68360 user? manual motorola bt ?burst transfer the bt bits control the maximum percentage of the imb that the idma can use during each 1024 clock cycle period after enabling the idma. 00 = idma gets up to 75% of the bus bandwidth. 01 = idma gets up to 50% of the bus bandwidth. 10 = idma gets up to 25% of the bus bandwidth. 11 = idma gets up to 12.5% of the bus bandwidth. note these percentages are valid only when using internal request generation (reqg = 00). rst?oftware reset this bit resets the idma to the same state as an external reset. the idma clears rst when the reset is complete. 0 = normal operation. 1 = the channel aborts any external pending or running bus cycles and terminates channel operation. setting rst clears all bits in the csr and cmr. note the user should reset the idma channel prior to issuing the lp- stop instruction. str?tart operation this bit starts the idma transfer if the reqg bits are programmed for an internal request. if the reqg bits are programmed for an external request, this bit must be set before the idma will recognize the first request on the dreqx input. 0 = stop channel. clearing this bit causes the idma to stop transferring data at the end of the current bus cycle. the idma internal state is not altered. 1 = start channel. setting this bit allows the idma to start transferring data (or continue if previously stopped). notes str is cleared automatically when the transfer is complete. if the str bit is cleared by software during the middle of an idma operand transfer, the idma will continue to hold the bit in a one state until the operand transfer has completed. thus, if the user waits for the str bit to be cleared after clearing it in soft- ware, he is assured that the values of sapr, dapr, and bcr accurately show the current state of the idma transfer. 7.6.2.3 source address pointer register (sapr). the sapr contains 32 address bits of the source operand used by the idma to access memory or memory- mapped peripheral controller registers. during the idma read cycle, the address on the master address bus is driven from this register. the sapr may be programmed by the sapi bits to be incremented or remain constant after each operand transfer.
idma channels motorola mc68360 user? manual 7-31 the register is incremented using unsigned arithmetic and will roll over if an overflow occurs. for example, if a register contains $ffffffff and is incremented by one, it will roll over to $00000000. this register can be incremented by one, two, or four, depending on the ssize bits and the starting address in this register. the sapr may be initialized by the host processor or by the risc controller via a buffer descriptor's ring structure when the rci bit is set for special buffer handling modes. 7.6.2.4 destination address pointer register (dapr). the dapr contains 32 address bits of the destination operand used by the idma to access memory or memory- mapped peripheral controller registers. during the idma write cycle, the address on the master address bus is driven from this register. the dapr may be programmed by the dapi bits to be incremented or remain constant after each operand transfer. the register is incremented using unsigned arithmetic and will roll over if overflow occurs. for example, if a register contains $ffffffff and is incremented by one, it will roll over to $00000000. this register can be incremented by one, two, or four, depending on the dsize bit and the starting address. the dapr may be initialized by the host processor or by the risc controller via a buffer descriptor's ring structure when the rci bit is set for special buffer handling modes. 7.6.2.5 function code register (fcr). each idma channel has an 8-bit fcr that is initialized to $00 at reset. during an idma bus cycle, the sfc and dfc bits define the source and destination function code values that are output by the idma and the appropriate address registers. the address space on the function code lines may be used by an external memory management unit (mmu) or other memory-protection device to translate the idma logical addresses to proper physical addresses. the function code value programmed into the fcr is placed on pins fc3?c0 during a bus cycle to further qualify the address bus value. notes this register is typically set to 1xxx1xxxb to cause the idma to operate in the dma function code space, as opposed to a cpu program or data space. to keep interrupt acknowledge cycles unique in the system, do not set this register to $77. 7.6.2.6 byte count register (bcr). this 32-bit register specifies the number of bytes of data to be transferred by the idma. the largest value that can be specified is 4 gbytes (bcr = $00000000). this register is decremented once for each byte transferred success- fully, for a total of 1, 2, or 4 per operand transfer. bcr may be even or odd as desired. the 76543210 dfc3?fc0 sfc3?fc0
idma channels 7-32 mc68360 user? manual motorola idma channel will terminate the transfer of a block of memory if this register reaches zero during operation. 7.6.2.7 channel status register (csr). the csr is an 8-bit register used to report events recognized by the idma controller. on recognition of an event, the idma sets its cor- responding bit in the csr, regardless of the corresponding bits in the cmar. the csr is a memory-mapped register that may be read at any time. a bit is reset by writing a one and is left unchanged by writing a zero. more than one bit may be reset at a time, and the register is cleared by reset. bits 7??eserved ad?uxiliary done this bit is valid in auto buffer and buffer chaining modes. it is set when the idma channel has completed a buffer transfer for a buffer descriptor (bd) that has its i-bit set. for ad to be set, the bcr must have been decremented to zero with no errors occurring during any idma transfer bus cycle. the idma will then move to the next bd and continue to transfer data. brkp?reakpoint this bit indicates that the breakpoint signal was asserted during an idma transfer. this bit is cleared by writing a one or by reset. writing a zero has no effect on brkp. ob?ut of buffers this bit is valid only when the risc controls the idma (rci bit in the cmr is set). it is set when working with the risc controller and there are no more valid buffers out of which to transfer data. bes?us error source this bit indicates that the idma channel terminated with an error during the read cycle. the channel terminates the idma operation without setting done. bes is cleared by writ- ing a one or by setting rst in the cmr. writing a zero has no effect on bes. bed?us error destination this bit indicates that the idma channel terminated with an error during the write cycle. the channel terminates the idma operation without setting done. bed is cleared by writ- ing a one or by setting rst in the cmr. writing a zero has no effect on bed. done?ormal channel transfer done this bit indicates that the idma channel has terminated normally. normal channel termi- nation is defined as follows: 1. in single buffer mode, the bcr has decremented to zero, and no errors have occurred during any idma transfer bus cycle. 76543210 ad brkp ob bes bed done
idma channels motorola mc68360 user? manual 7-33 2. in buffer chaining or auto buffer modes, the bcr has decremented to zero, the l-bit in the bd has been set, and no errors have occurred during any idma transfer bus cycle. 3. an external peripheral has asserted donex during an access by the idma to that peripheral and no errors have occurred during any idma transfer bus cycle. done will not be set if the channel terminates due to an error. done is cleared by writing a one or by setting rst in the cmr. writing a zero has no effect on done. 7.6.2.8 channel mask register (cmar). the cmar is an 8-bit, memory-mapped, read-write register that has the same bit format as the csr. if a bit in the cmar is a one, the corresponding interrupt in the csr will be enabled. if the bit is a zero, the corresponding interrupt in the csr will be masked. cmar is cleared at reset. 7.6.2.9 data holding register (dhr). this 7-byte register serves as a buffer register for the data being transferred during dual address idma cycles. no address for dhr is given since this register cannot be addressed by the programmer. the dhr allows the data to be packed and unpacked by the idma during the transfer. for example, if the source operand size is byte and the destination operand size is word, then two-byte read cycles occur, fol- lowed by a one-word write cycle. the two bytes of data are buffered in the dhr until the word write cycle occurs. the dhr allows for packing and unpacking of operands for all pos- sible combinations: bytes to words, bytes to long words, words to long words, words to bytes, long words to bytes, and long words to words. 7.6.3 interface signals the idma has three dedicated control signals per channel: dma request (dreqx ), dma acknowledge (dackx ), and end of idma transfer (donex ). the peripheral used with these signals may be either a source or a destination of the idma transfers. note dreq must be level sensitive if idma uses buffer chaining mode. 7.6.3.1 dreq and dack . these are the handshake signals between the peripheral requiring service and the quicc. when the peripheral requires idma service, it asserts dreqx , and the quicc begins the idma process. when the idma service is in progress, dackx is asserted during accesses to the device. dreqx is ignored when the idma is pro- grammed to one of the internal request modes. 7.6.3.2 donex . this bidirectional open-drain signal is used to indicate the last idma trans- fer. donex is always an output of the idma if the transfer count is exhausted. donex may also operate as an input. if donex is externally asserted during internal request modes, the idma transfer is terminated. with external request modes, donex may be used as an input to the idma controller to indicate that the device being serviced requires no more transfers and the transmission is to be terminated.
idma channels 7-34 mc68360 user? manual motorola 7.6.4 idma operation every idma operation involves the following steps: idma channel initialization, data trans- fer, and block termination. in the initialization phase, the core (or external processor) loads the registers with control information, initializes the idma bds (if auto buffer or buffer chain- ing is used), and then starts the channel. in the transfer phase, the idma accepts requests for operand transfers and provides addressing and bus control for the transfers. the termi- nation phase occurs when the operation is complete and the idma interrupts the core if interrupts are enabled. to initialize a block transfer operation, the user must initialize the idma registers. for the auto buffer and buffer chaining modes, the idma bds must be initialized with information describing the data block, device type, request generation method, and other special control options. see 7.6.2 idma registers and 7.6.4.2.3 idma commands (init_idma) for further details. 7.6.4.1 single buffer. the single buffer mode is used to transfer only one buffer of data. when the buffer has been completely transferred (transfer count exhausted or donex is asserted), the idma channel operation is terminated, str is cleared, and a maskable interrupt is generated by the done bit in the csr. 7.6.4.2 auto buffer and buffer chaining. the auto buffer and the buffer chaining modes are supported with the risc controller by setting the rci bit in the cmr. the host processor should initialize the idma bd ring (see figure 7-9) with the appropriate buffer handling mode, source address, destination address, and block length. the user then sets the str bit in the cmr. all transfer modes described in 7.6.4.4.4 external cycle steal are still valid. the function codes for the source and destination addresses are programmed as described in 7.5.2.5 timer capture registers (tcr1, tcr2, tcr3, tcr4).
idma channels motorola mc68360 user? manual 7-35 figure 7-9. idma bd ring the data associated with each idma channel for the auto buffer and buffer chaining modes is stored in buffers. each buffer is referenced by a bd. the bds use a ring structure located in the dual-port ram. 7.6.4.2.1 idma parameter ram. when an idma channel is configured to the auto buffer or buffer chaining mode, the quicc uses the idma parameters listed in table 7-2.t note: the entry in boldface must be initialized by the user. the ibase entry defines the starting location in the dual-port ram for the set of idma bds. it is an offset from the beginning of the dual-port ram. the user must initialize this entry before enabling the idma channel. furthermore, the user should not overlap bd tables of two enabled serial channels or idma channels, or erratic operation will result. ibase should contain a value that is divisible by 16. table 7-3. idma parameter ram address name width description idma base + 00 ibase word idma bd base address idma base + 02 ibptr word idma bd pointer idma base + 04 istate long idma internal state idma base + 08 itemp long idma temp idma bd base address (ibase) bd 0 bd 1 bd 2 bd n source device or data buffer 0 source device or data buffer 1 source device or data buffer 2 source device or data buffer n destination device or data buffer 0 destination device or data buffer 1 destination device or data buffer 2 destination device or data buffer n
idma channels 7-36 mc68360 user? manual motorola the ibptr entry points to the next bd that the idma will transfer data to when it is in idle state or points to the current bd during transfer processing. after a reset or when the end of an idma bd table is reached, the cp initializes this pointer to the value programmed in the ibase entry. istate and itemp are for risc use only. 7.6.4.2.2 idma buffer descriptors (bds). source addresses, destination addresses, and byte counts are presented to the risc controller using special idma bds. the risc con- troller reads the bds, programs the idma channel, and notifies the cpu32+ about the com- pletion of a buffer transfer using the idma bds. this concept is like that used for the serial channels on the quicc, except that the bd is larger to contain additional information. note: entries in boldface must be initialized by the user. the following bits are prepared by the user before transfer and are set by the risc controller after the buffer has been transferred. v?alid 0 = the data buffers associated with this bd are not currently ready for transfer. the user is free to manipulate this bd or its associated data buffer. when it is not in auto buffer mode, the risc controller clears this bit after the buffer has been trans- ferred (or after an error condition is encountered). 1 = the data buffers have been prepared for transfer by the user. (note that only one data buffer needs to be prepared if the source/destination is a peripheral device.) it may be only the source data buffer when the destination is a device or the desti- nation data buffer when the source is a device. no fields of this bd may be written by the user once this bit is set. note the only difference between auto buffer mode and buffer chain- ing mode is that the v-bit is not cleared by the risc controller in the auto buffer mode. auto buffer mode is enabled by the cm bit. 1514131211109876543210 offset + 0 v w i l cm sededa offset + 2 offset + 4 data length offset + 6 offset + 8 source data buffer pointer offset + a offset + c destination data buffer pointer offset + e
idma channels motorola mc68360 user? manual 7-37 w?rap (final bd in table) 0 = this is not the last bd in the table. 1 = this is the last bd in the table. after the associated buffer has been used, the risc controller will transfer data from the first bd in the table (pointed to by ibase). the number of bds in this table is programmable and is determined only by the w-bit and the overall space constraints of the dual-port ram. i?nterrupt 0 = no interrupt is generated after this buffer has been serviced. 1 = when this buffer has been serviced by the risc controller the ad bit in the csr will be set, which can cause an interrupt. l?ast 0 = this is not the last buffer to be transferred in the buffer chaining mode. the i-bit may be used to generate an interrupt when this buffer has been serviced. 1 = this is the last buffer to be transferred in the buffer chaining mode. when the trans- fer count is exhausted, the start bit will be reset and an interrupt (done) will be generated, regardless of the i-bit. cm?ontinuous mode 0 = buffer chaining mode. the risc will clear the v-bit after this bd is serviced. the buffer chaining mode is used for transferring large quantities of data into noncon- tiguous buffer areas. the user can initialize bds ahead of time, if desired. the risc controller automatically reloads the idma registers from the next bd? values when the transfer is terminated. if donex is asserted by an external peripheral, the buffer will be closed, the str bit will be reset, and the done bit will be set in the csr, which can cause an interrupt. 1 = auto buffer mode (continuous mode). the risc will not clear the v-bit after this bd is serviced. this is the only difference between auto buffer mode and buffer chain- ing mode behavior. the auto buffer mode is used to transfer multiple groups of data to/from a buffer ring. this mode does not require reprogramming. the risc con- troller automatically reloads the idma registers from the next bd values when the transfer is terminated. either a single bd or multiple bds may be used in this mode to create an infinite loop of repeated data moves. note the i-bit may still be used to generate an interrupt in this mode. the following bits are written by the risc controller after it has finished receiving data from the associated data buffer. se?ource access bus error the buffer was closed due to a bus error on the source access. an interrupt (bes) will be generated, regardless of the i-bit. the risc will clear the v-bit of this bd.
idma channels 7-38 mc68360 user? manual motorola de?estination access bus error the buffer was closed due to a bus error on the destination access. an interrupt (bed) will be generated, regardless of the i-bit. the risc will clear the v-bit of this bd. da?one asserted during transfer the buffer was closed due to the assertion of donex . an interrupt (done) will be gener- ated, regardless of the i-bit. the risc will clear the v-bit of this bd. data length the data length is the number of bytes that the idma should transfer from/to this bd? data buffer. the data length should be programmed to a value greater than zero. source buffer pointer the source buffer pointer contains the address of the associated source data buffer. the buffer may reside in either internal or external memory. note in single address mode when the source is a device, this field is ignored. in dual address mode when the source is a device, this field should contain the device address. destination buffer pointer the destination buffer pointer contains the address of the associated destination data buffer. the buffer may reside in either internal or external memory. note in single address mode when the destination is a device, this field is ignored. in dual address mode when the destination is a device, this field should contain the device address. 7.6.4.2.3 idma commands (init_idma). this command causes the risc controller to reinitialize its idma internal state to the condition it had after a system reset. the idma bd pointer is reinitialized to the top of bd ring. when in the auto buffer and buffer chaining modes, the idma can be reset by setting the rst bit in the cmr and issuing the init_idma command. the init_idma command should only be executed in conjunction with the set- ting of the rst bit in the cmr. 7.6.4.3 starting the idma. once the channel has been initialized with all parameters required for a transfer operation, it is started by setting the str bit in the cmr. after the channel has been started, any register that describes the current operation may be read but not modified (sapr, dapr, fcr, or bcr). once str has been set, the channel is active and either accepts operand transfer requests in external mode or generates requests automatically in internal mode. when the first valid external request is recognized, the idma arbitrates for the bus. the dreqx input is ignored until str is set.
idma channels motorola mc68360 user? manual 7-39 for the single buffer mode, str is cleared automatically when the bcr reaches zero or when donex is asserted externally. for the other buffer handling modes see 7.6.4.8.2 auto buffer mode termination. and 7.6.4.8.3 buffer chaining mode termination. the str is cleared in all modes if the idma cycle is terminated by a bus error. channel transfer operation may be suspended at any time by clearing str in software. in response, any operand transfer in progress will be completed, and the bus will be released. no further bus cycles will be started while str remains cleared. during this time, the cpu32+ core may access idma internal registers to determine channel status or to alter operation. when str is set again, if a transfer request is pending, the idma will arbitrate for the bus and continue normal operation. interrupts from the idma are sent to the interrupt controller. in the interrupt handler, the unmasked bits in the csr should be cleared (by writing them with a one) to negate the inter- rupt request to the cpm interrupt controller. 7.6.4.4 requesting idma transfers. once the idma has been started, the transfers can be requested to the idma. idma transfers may be initiated by either internally or externally generated requests. inter- nally generated requests can be initiated by setting str in the cmr or, in auto buffer and buffer chaining modes, by also setting rci in the cmr and preparing a data buffer to the risc controller. externally generated transfers are those requested by an external device using dreqx in conjunction with the activation of str. 7.6.4.4.1 internal maximum rate. the first method of internal request generation is a non- stop transfer until the transfer count is exhausted. if this method is chosen, the idma will arbitrate for the bus and begin transferring data after str is set and the idma becomes the bus master. during each access to the device (determined by the eco bit in the cmr), the idma will assert dackx to indicate to the device that it is being serviced. if no exception occurs, all operands in the data block will be transferred in one burst with the idma using 100% of the available bus bandwidth (unless a higher priority bus master requests the bus or a higher priority interrupt requests service). see 7.6.2.2 channel mode register (cmr) for more detail. 7.6.4.4.2 internal limited rate. to guarantee that the idma will not use all the available system bus bandwidth during a transfer, internal requests can be limited to the amount of bus bandwidth allocated to the idma. programming the reqg bits to internal limited rate and the bt bits to determine the percentage of bandwidth achieves this result. the options are 12.5%, 25%, 50%, or 75% of the bus. as soon as str is set, the idma module arbitrates for the bus and begins to transfer data when it becomes bus master. during each access to the device (determined by the eco bit in the cmr), the idma will assert dackx to indicate that it is being serviced. if no exception occurs, transfers will continue normally, but the idma will not exceed the percentage of bus bandwidth programmed into the control register. the percentage is calculated over each ensuing 1024 internal clock cycle period. for example, if 12.5% is chosen, the idma will attempt to use the bus for the first 128 clocks of each 1024 clock cycle period. however, because of other bus masters or higher priority
idma channels 7-40 mc68360 user? manual motorola interrupts, the idma may not be able to take its 128 clock allotment in a single burst. if, for whatever reason, the idma is not able to take its full 128 clock allotment in a 1024 clock cycle period, the idma is still only granted a 128 clock allotment in the next 1024 clock cycle period. 7.6.4.4.3 external burst mode. for external devices requiring very high data transfer rates, the external burst mode allows the idma to use all of the bus bandwidth to service the device (see figure 7-10). in the burst mode, the dreqx input to the idma is level-sensitive and is sampled at falling edges of the clock to determine when a valid request is asserted by the device. the device requests service by asserting dreqx and leaving it asserted. in response, the idma begins to arbitrate for the system bus. if dreqx is negated prior to the idma winning the bus, the idma will cease requesting the bus. if dreqx is negated long enough for the idma to win the bus, cycles will continue as long as dreqx is asserted and no higher priority bus master or interrupt occurs. figure 7-10. external burst requests; each time the idma issues a bus cycle to either read or write the device, the idma will out- put the dackx signal. the device is either the source or destination of the transfers, as as (output) dsackx (i/o) s0 s2 s4 s0 s2 s4 s0 s2 s4 s0 s2 s4 s0 s2 s4 dreqx (input) dackx (output) idma write other cycle notes: 1. this example assumes dual address mode. in single address mode, the dreqx sample points would occur in every idma cycle. 2. this example assumes srm = 1 in the cmr. if srm = 0, dreqx would have to be asserted and negated one clock earlier that what is shown to allow it to be internally synchronized by the idma before it is used. alternatively, the timing shown would be correct for the srm = 0 case if a wait state were included (between s3 and s4) in all cycles shown above. clko1 idma read idma write idma read dreq sampled low stop burst eco = 1; peripheral is read. dreqx (input) dackx (output) dreq sampled low stop burst eco = 0; peripheral is written. continue burst continue burst
idma channels motorola mc68360 user? manual 7-41 determined by the eco bit in the cmr. the dackx timing is similar to the timing of the as pin. thus, dackx is the acknowledgment of the original burst request given on the dreqx pin. during each access to the device (i.e., dackx is asserted), the idma will sample dreqx at the s3 falling edge of the bus cycle to determine whether the burst should continue. if dreqx is asserted, the burst continues. if dreqx is negated, the burst ceases, and another operand transfer to/from the device does not occur until dreqx is asserted again. if dreqx is negated, but not in time to stop the burst on this bus cycle, one additional bus cycle to the device will occur before the idma stops the burst. notes because dackx timing is similar to as timing, the user typically uses the assertion of dackx as an indication that dreqx is ne- gated. to meet the s3 sampling time, dreqx should be negated no later than dsackx because dsackx pins are also sampled at falling s3 to determine the end of the bus cycle. the previous paragraphs discuss the general rules; however, important special cases are discussed in the following points: 1. the sample point at the s3 falling edge means the last s3 before the s4 edge that completes the cycle. thus, if wait states are inserted in the bus cycle, the sample point is later in the cycle. 2. the sample point at s3 assumes that the required setup time is met, as defined in sec- tion 10 electrical characteristics. 3. if srm is cleared in the cmr (default condition), then dreqx is synchronized inter- nally before it is used; therefore, dreqx must be negated one clock earlier than the s3 falling edge to be recognized on that cycle. 4. if operand packing is performed, the user does not need to negate dreqx on any par- ticular access to the device. for instance, if the source is a 32-bit memory and the des- tination is an 8-bit peripheral, dreqx can be negated on the first, second, third, or fourth byte access to the peripheral. in each case, if the dreqx negation timings are met, the idma will stop accessing the peripheral immediately with no additional bus cycles to the peripheral. accesses to the peripheral will resume when dreqx is as- serted. 5. if operand packing is performed and the peripheral is the source and dreqx is negat- ed to stop the burst, the idma will attempt to empty the contents of the dhr (by per- forming one additional write cycle to memory) before giving up the bus. the idma attempts to minimize the contents of the dhr between burst requests. 6. if the access to the device is a fast termination access, the dreqx negation timing cannot be met, and one additional bus cycle will always occur to the device before the burst stops.
idma channels 7-42 mc68360 user? manual motorola 7.6.4.4.4 external cycle steal. for external devices that generate a pulsed signal for each operand to be transferred, the external cycle steal mode should be used. in external cycle steal mode, the idma moves one operand for each falling edge of the dreqx input (see figure 7-11). in this mode, dreqx is sampled at each falling edge of the clock to determine when a valid request is asserted by the device. when the idma detects a falling edge on dreqx , a request becomes pending and remains pending until it is serviced by the idma. further falling edges on dreqx are ignored until the request begins to be serviced. the ser- vicing of the request results in one operand being transferred. the operand will be trans- ferred in back-to-back read and write cycles as long as no other higher priority bus master or interrupt occurs between the bus cycles. figure 7-11. external cycle steal each time the idma issues a bus cycle to either read or write the device, the idma will out- put the dackx signal. the device is either the source or destination of the transfers, as determined by the eco bit in the cmr. the dackx timing is similar to the timing of the as as (output) dsackx (i/o) s0 s2 s4 s0 s2 s4 s0 s2 s4 s0 s2 s4 s0 s2 s4 dreqx (input) dackx (output) idma write other cycle notes: 1. this example assumes dual address mode. in single address mode, the dreqx sample points would occur in every idma cycle. 2. this example assumes srm = 1 in the cmr. if srm = 0, dreqx would have to be asserted one clock earlier and remain asserted for one clock longer than what is shown to allow it to be internally synchronized by the idma 3. the sample point for "another request" determines that another idma transfer will occur following the current idma operand transfer. during that time, if the idma remains the highest priority bus master of the imb, the trans- fers will occur back-to-back as shown. clko1 idma read idma write idma read cycle steal request another request eco = 1; peripheral is read. dreqx (input) dackx (output) eco = 0; peripheral is written. cycle steal request another request before it is used. alternatively, the user could assert dreqx as shown and keep dreqx asserted for one additional clock in the srm = 0 case, if a wait state were included (between s3 and s4) in all cycles shown above.
idma channels motorola mc68360 user? manual 7-43 pin. thus, dackx is the acknowledgment of the original cycle steal request given on the dreqx pin. it is possible to cause the idma to perform back-to-back cycle steal requests. to achieve this, dreqx should be asserted to generate the first request, negated, and reasserted dur- ing the access to the device. if the idma detects that dreqx is reasserted prior to the s3 falling edge of the bus cycle to the device (i.e., bus cycle when dackx is asserted), then another back-to-back cycle steal request will be performed. otherwise, the bus is relin- quished. if dreqx was not reasserted soon enough, a new request will be made to the idma, but the bus will be relinquished and re-requested by the idma. note to generate back-to-back cycle steal requests, dreqx should be reasserted after dackx is asserted, but before the s3 falling edge. instead of saying before the s3 falling edge, one could also say before or with the assertion of dsackx because the dsackx pins are also sampled at falling s3 to determine the end of the bus cycle. the previous paragraphs discuss the general rules; however, important special cases are discussed in the following points: 1. the sample point at the s3 falling edge means the last s3 before the s4 edge that completes the cycle. thus, if wait states are inserted in the bus cycle, the sample point is later in the cycle. 2. the sample point at s3 assumes that the required setup time is met, as defined in sec- tion 10 electrical characteristics. 3. if srm is cleared in the cmr (default condition), then dreqx is synchronized inter- nally before it is used; therefore, dreqx must be reasserted one clock earlier than the s3 falling edge to be recognized on that cycle and generate a back-to-back request. 7.6.4.5 idma bus arbitration. once the idma receives a request for a transfer, it begins arbitrating for the imb. (the four request types are internal maximum rate, internal limited rate, external burst, and external cycle steal.) on the quicc, the idmas, sdmas, and dram refresh controller, called internal masters, have the capability to become bus master. to determine the relative priority of these mas- ters, each is given an arbitration id. the user programs the arbitration id (a value between 0 and 7) of the idmas into the iccr. the arbitration ids of the two idmas must be different by a value of 2 (e.g., idma1 id = 2 and idma2 id = 0). these values are used to determine the relative priority of the idma channel and the other internal bus masters. note typically, the idma ids are configured by the user to be the low- est of the internal bus masters.
idma channels 7-44 mc68360 user? manual motorola imb bus masters request bus ownership on a per-cycle basis. thus, on each bus cycle, the imb is given to the highest priority bus master requesting the bus. external bus masters may also request the bus and obtain priority over the internal bus masters. in addition, on the quicc, interrupts may take priority over bus masters. thus, another con- dition for the idma to obtain the bus is for the interrupt service level on the imb to be less than or equal to the interrupt service mask (ism bits) in the iccr. if the cpu32+ is enabled, the idma bus arbitration sequence is like that shown in figure 7- 12. the br , bg , and bgack signals are not affected during the arbitration sequence. the only external indication of an idma bus request is the bus clear out (bclro ) pin. bclro is only available externally if programmed in the sim60 port e pin assignment register. addi- tionally, bclro is only asserted if the idma id for that channel is greater than the value programmed into the bclroid2-bclroid0 bits in the sim60 module configuration regis- ter. bclro can be used to clear off an external bus master from the external bus, if desired. for instance, bclro can be connected through logic to the external master? halt signal, and then negated externally when the external master? as signal is negated. bclro is negated during s2 of the final idma bus cycle before it relinquishes the bus. figure 7-12. idma bus arbitration (normal operation) as (output) dsackx (i/o) s0 s2 s4 s0 s2 s4 s0 s2 s4 s0 dreqx (input) dackx (output) idma write other cycle notes: 1. the bclro signal is only asserted if the idma bus arbitration id is greater than the bclroid2?clroid0 bits in the sim60 module configuration register. 2. note that the br, bg, and bgack signals are not affected by the idma bus arbi- tration process if the cpu32+ is enabled. clko1 idma read dreq sampled low bclro (output) br (input) bg (output) bgack (i/o)
idma channels motorola mc68360 user? manual 7-45 the relative priority between the two idmas and sdma channels is user programmable. regardless of the system configuration, if the sdma is a bus master when a higher priority idma channel needs to transfer over the bus, the idma will steal cycles from the sdma with no arbitration overhead. when the quicc is in slave mode (cpu32+ disabled), the idma can steal cycles from the sdma with no arbitration overhead. see section 4 bus operation for diagrams of bus arbi- tration by an internal master in slave mode. additionally, when the quicc is in slave mode, the bclri pin can be used to force the idma and other internal bus masters off the bus. the bclri pin is assigned an arbitration id in slave mode to allow a selection of which internal bus masters are allowed to be forced off the bus. an application of this capability is to connect the bclro pin of a quicc in nor- mal operation to the bclri pin of a quicc in slave mode. this configuration allows the user to implement capabilities such as giving all sdma channels priority over all idma channels in the system. 7.6.4.6 idma operand transfers. once the idma successfully arbitrates for the bus, it can begin making operand transfers. the source idma bus cycle has timing identical to an internal master read bus cycle. the destination idma bus cycle has timing identical to an internal master write bus cycle. the two-channel idma module supports dual and single address transfers. the dual address operand transfer consists of a source operand read and a destination operand write. each single address operand transfer consists of one external bus cycle, which allows either a read or a write cycle to occur. 7.6.4.6.1 dual address mode. the two idma channels can each be programmed to oper- ate in a dual address transfer mode (see figure 7-13). in this mode, the operand is read from the source address specified in the sapr and placed in the dhr. the operand read may take up to four bus cycles to complete because of differences in operand sizes of the source and destination. the operand is then written to the address specified in the dapr. this transfer may also be up to four bus cycles long. in this manner, various combinations of peripheral, memory, and operand sizes may be used. the dual address transfers can be started either by the internal request mode or by an exter- nal device using dreqx . when the external device uses dreqx , the channel can be pro- grammed to operate in either the cycle steal or burst transfer modes. see 7.6.4.4.3 external burst mode and 7.6.4.4.4 external cycle steal for information about these modes. dual address source read . during this type of idma cycle, the sapr drives the address bus, the fcr drives the source function codes, and the cmr drives the size control. data is read from the memory or peripheral and placed in the dhr when the bus cycle is termi- nated. when the complete operand has been read, the sapr is incremented by 1, 2, or 4, depending on the address and size information specified by the sapi and ssize bits of the cmr. see 7.6.2.3 source address pointer register (sapr) for more information.
idma channels 7-46 mc68360 user? manual motorola figure 7-13. dual address transfer example dual address destination write . during this type of idma cycle, the data in the dhr is written to the device or memory selected by the address in the dapr, the destination func- tion codes in the fcr, and the size in the cmr. the same options exist for operand size and alignment as in the dual address source read. when the complete operand is written, the dapr is incremented by 1, 2, or 4, according to the dapi and dsize bits of the cmr, and the btc is decremented by the number of bytes transferred. if the btc is equal to zero, the donex signal for the idma handshake is asserted, and if the transfer is completed with no errors, the done bit in the csr is set. see 7.5.2.4 timer reference registers (trr1, trr2, trr3, trr4) and 7.6.2.6 byte count register (bcr) for more information. dual address packing . when dual address mode is selected, the idma can perform pack- ing. regardless of the source size, destination size, source starting address, or destination starting address, the idma will use the most efficient packing algorithm possible to perform the transfer in the fewest possible number of bus cycles. note the packing algorithms are subject to the restriction that the idma never performs 3-byte transfers. three examples of the packing technique follow. example 1. this simple example shows how packing is performed when the source and des- tination sizes are the same?ord. the source address is $00000001, and the destination address is $20000000. the number of bytes to be transferred is 4. idma channel 1 initialization required for this example: ?ccr = $0720. recommended normal configuration. ?cr1 = $89. source function code is 1000; destination function code is 1001. ?apr1 = $00000001. source address. ?apr1 = $20000000. destination address. ?cr1 = $00000003. byte transfer count. peripheral memory 1 2 dhr two bus cycles required data bus dackx and addr. addr. quicc idma 1
idma channels motorola mc68360 user? manual 7-47 ?sr1 = $ff. clear any csr bits that are currently set. ?mar1 = $00. disable interrupts for this example. ?mr1 = $47a1. internal maximum transfer rate; starts idma. example 2. this more complicated example shows how packing is performed when the source and destination sizes are the same?ong word. this example also shows the entire 7-byte dhr in use. the source address is $00000000, and the destination address is $20000003. the number of bytes to be transferred is 16. idma channel 1 initialization required for this example: iccr = $0720. recommended normal configuration. fcr1 = $89. source function code is 1000; destination function code is 1001. sapr1 = $00000000. source address. dapr1 = $20000003. destination address. bcr1 = $00000010. byte transfer count. csr1 = $ff. clear any csr bits that are currently set. cmar1 = $00. disable interrupts for this example. cmr1 = $4701. internal maximum transfer rate; starts idma. example 3. this example shows how packing operates when the source and destination sizes are different. the source address is $00000002, and the destination address is $20000002. the source size is long word, and the destination size is byte. the number of bytes to be transferred is 8. bus access # address (hex) operation no. bytes no. bytes in dhr 1 $00000001 read 1 1 2 $00000002 read 2 3 3 $20000000 write 2 1 4 $00000002 write 1 0 bus access # address (hex) operation no. bytes no. bytes in dhr 1 $00000000 read 4 4 2 $20000003 write 1 3 3 $00000004 read 4 7 4 $20000004 write 4 3 5 $00000008 read 4 7 6 $20000008 write 4 3 7 $0000000c read 4 7 8 $2000000c write 4 3 9 $20000010 write 2 1 10 $20000012 write 1 0
idma channels 7-48 mc68360 user? manual motorola idma channel 1 initialization required for this example: iccr = $0720. recommended normal configuration. fcr1 = $89. source function code is 1000; destination function code is 1001. sapr1 = $00000002. source address. dapr1 = $20000002. destination address. bcr1 = $00000008. byte transfer count. csr1 = $ff. clear any csr bits that are currently set. cmar1 = $00. disable interrupts for this example. cmr1 = $4711. internal maximum transfer rate; starts idma. 7.6.4.6.2 single address mode (flyby transfers). each idma channel can be indepen- dently programmed to provide single address transfers. figure 7-14 illustrates a transfer from memory to a peripheral. the dhr is not used by the idma, since the transfer occurs directly from a device to memory. this mode is often referred to as "flyby" mode because the dhr is not used. figure 7-14. single address transfer example bus access # address (hex) operation no. bytes no. bytes in dhr 1 $00000002 read 2 2 2 $20000002 write 1 1 3 $20000003 write 1 0 4 $00000004 read 4 4 5 $20000004 write 1 3 6 $20000005 write 1 2 7 $20000006 write 1 1 8 $20000007 write 1 0 9 $00000008 read 2 2 10 $20000008 write 1 1 11 $20000009 write 1 0 quicc peripheral idma memory 1 just one bus cycle required data bus addr. dackx 1
idma channels motorola mc68360 user? manual 7-49 both internal and external request modes can be used to start a transfer when the single address mode is selected (see figure 7-15). the eco bit in the cmr controls whether a source read or a destination write cycle occurs on the data bus. if the eco bit is set, the external handshake signals are used with the source operand, and a single address source read occurs. if the eco bit is cleared, the external handshake signals are used with the des- tination operand, and a single address destination write occurs. note single address mode does not support access to the internal dual port ram of mc68360. in order to transfer from/to internal dual port ram, user should use dual address mode. figure 7-15. single address mode timing single address source read. during the single address source read cycle, the device or memory selected by the address in the sapr, the source function codes in the fcr, and the size in the cmr provides the data and control signals on the data bus. this bus cycle operates like a normal read bus cycle. the destination device is controlled by the idma handshake signals (dreqx , dackx , and donex ). the assertion of dackx provides the write control to the destination device. for more details about the idma handshake signals, see 7.6.3 interface signals. as (output) dsackx (i/o) s0 s2 s4 s0 s2 s4 s0 s2 s4 s0 dreqx (input) other cycle note: 1. this example assumes the peripheral is being written. if the peripheral is being read, r/w would be low during the transfers. 2. this example shows the operation of dreq in two different modes. 3. this example assumes that srm = 0 in the cmr. otherwise, dreqx would not be recognized by the idma until it had been sampled on two consecutive falling edges of the clock. clko1 idma memory read peripheral write cycle steal request another transfer cycle steal request dreqx (input) dackx (output) burst mode request stop burst continue burst dreq sampled low idma memory read peripheral write r/w (output)
idma channels 7-50 mc68360 user? manual motorola single address destination write . during the single address destination write cycle, the source device is controlled by the idma handshake signals (dreqx , dackx , and donex ). when the source device requests service from the idma channel, the idma asserts of dackx to allow the source device to drive data onto the data bus. the data is written to the device or to memory selected by the address in the dapr, the destination function codes in the fcr, and the size in the cmr. the data bus is placed in a high-impedance state for this write cycle. for more details about the idma handshake signals, see 7.6.3 interface signals. 7.6.4.6.3 fast-termination option. while in the operand transfer phase, the idma sup- ports an option to achieve a transfer in the shortest possible number of clocks (see figure 7-16). figure 7-16. fast termination example using the sim60 chip-select logic, the fast-termination option can be employed to give a fast bus access of two clock cycles rather than the standard three-cycle access time. the fast- termination option is described in section 6 system integration module (sim60) and in sec- tion 4 bus operation. if the fast-termination option is used with external request burst mode, an extra idma cycle results on every burst transfer. in the burst mode with fast termination selected, a new cycle starts even if dreqx negation and dackx assertion occur simultaneously. as (output) dsackx (i/o) s0 s2 s4 s0 s2 s4 s0 s4 s0 dreqx (input) other cycle note: this example shows a fast termination on the write cycle. the fast termination may occur on the read, write, or both. clko1 idma read cycle steal request dackx (output) eco = 0 idma fast termination write r/w (output) dackx (output) eco = 1 peripheral is being read peripheral is being written
idma channels motorola mc68360 user? manual 7-51 7.6.4.6.4 externally recognizing idma operand transfers. there are several methods to externally determine that a bus cycle is being executed by the idma: 1. the function code lines may be programmed to a unique function code that identifies an idma transfer. 2. the bclro pin can be used to show when the bus request is made. bclro is ne- gated during the final access by the idma before relinquishing the bus. 3. the dackx signal shows accesses to the peripheral device. dackx will operate even in the internal request modes and will activate on either the source or destination bus cycles, depending on the eco bit in the cmr. note items 1 and 2 may also be used by the sdma channels. 7.6.4.7 bus exceptions. while the idma has the bus and is performing operand trans- fers, it is possible for bus exceptions to occur. in any computer system, the possibility exists that an error will occur during a bus cycle due to a hardware failure, random noise, or an improper access. when an asynchronous bus structure, such as that supported by the m68000 is used, it is easy to make provisions allow- ing a bus master to detect and respond to errors during a bus cycle. the idma recognizes the same bus exceptions as the cpu32+ core: reset, bus error, halt, and retry. 7.6.4.7.1 reset. upon an external reset, the idma immediately aborts the channel opera- tion, returns to the idle state, and clears csr and cmr (including the str bit). if a bus cycle is in progress when reset is detected, the cycle is terminated, the control and address/data pins are three-stated, and bus ownership is released. the idma can also be reset by rst in the cmr. 7.6.4.7.2 bus error. when a fatal error occurs during a bus cycle, a bus error exception is used to abort the cycle and systematically terminate that channel? operation. the idma ter- minates the current bus cycle, signals an error in the csr using either the bes or bed bit, and signals an interrupt if the corresponding bit in the cmar is set. the idma clears str and waits for a restart of the channel and the negation of berr before starting any new bus cycles. any data that was previously read from the source into the dhr will be lost. note any device that is the source or destination of the operand under idma handshake control for single address transfers may need to monitor berr to detect a bus exception for the current bus cycle. berr terminates the cycle immediately and negates dackx , which is used to control the transfer to or from the de- vice. 7.6.4.7.3 retry. when halt and berr are asserted during a bus cycle, the idma termi- nates the bus cycle, releases the bus, and suspends further operation until these signals are negated. when halt and berr are negated, the idma will arbitrate for the bus, re-execute the previous bus cycle, and continue normal operation.
idma channels 7-52 mc68360 user? manual motorola if the idma has obtained the imb and is also waiting to obtain the external bus, but the exter- nal bus master performs an access to a location internal to the quicc, the idma will relin- quish the imb and retry the cycle once it has obtained the imb. 7.6.4.8 ending the idma transfer. if no bus exceptions occur, the idma eventually finishes the transfer of a block of data. these paragraphs describe normal termination in more detail. (termination by error is discussed in 7.6.4.7.2 bus error.) the idma channel operation experiences normal termination when the bcr is decre- mented to zero or the external device signals a termination of the transfer using donex . these terminations are independent of how requests are generated to the idma. additionally, the user may stop the idma channel by clearing str. however, this is consid- ered a suspension of activity, rather than normal termination, since the transfer resumes when str is set once again. the user may also terminate the transfer by setting the rst bit in the cmr; however, this is not a normal termination of idma activity. further description of normal termination depends on the mode of the idma: single buffer mode, auto buffer mode, and buffer chaining. these modes are described in the following paragraphs. 7.6.4.8.1 single buffer mode termination. the following methods may be used to termi- nate an idma transfer in the single buffer mode. they may also be used to terminate a cur- rent bd transfer in the auto buffer and buffer chaining modes. transfer count exhausted. when the channel performs an operand transfer, it decre- ments the bcr for each byte transferred successfully. when the bcr is decremented to zero, the transfer is terminated. when the last bus cycle of the transfer occurs (either a byte, word, or long-word access), donex is asserted during that bus cycle. if the device is the source, further destination accesses will take place after donex is asserted. if the device is the destination, donex will be asserted on the final bus cycle of the destination write. note this behavior of donex also applies to memory-to-memory transfers. donex is asserted on either the last source or desti- nation bus cycle, as determined by the eco bit in the cmr. when the operand transfer has completed and the bcr has been decremented to zero, the channel operation is terminated, str is cleared, and a done bit interrupt is generated if the corresponding cmar bit is set. the sapr and/or dapr are also incremented in the normal fashion. note if the channel was started with the bcr value set to zero, the channel will transfer 4 gbytes before the transfer count is ex- hausted.
idma channels motorola mc68360 user? manual 7-53 external device termination . if the donex pin is asserted externally, a transfer may be terminated by the device even before the bcr is decremented to zero. donex is sampled by the idma on the access to the device. note this behavior of donex also applies to memory-to-memory transfers. donex is sampled on either the source or destination bus cycles, as determined by the eco bit in the cmr. if donex is asserted on a bus cycle to a source device, the destination accesses will be performed before the idma terminates transfers. if donex is asserted during a bus cycle to a destination device, no further idma bus cycles occur, and the idma terminates trans- fers. the idma samples donex on the s3 falling edge of the bus cycle. thus, the user should assert donex at least one setup time before the s3 falling edge for donex to be recog- nized on that bus cycle. notes because dackx timing is similar to as timing, the user uses the assertion of dackx as an indication that donex is asserted. to meet the s3 sampling time, donex should be asserted no later than dsackx because the dsackx pins are also sampled at falling s3 to determine the end of the bus cycle. the previous paragraphs discuss the general rules; however, important special cases are discussed in the following points: 1. the sample point at the s3 falling edge means the last s3 before the s4 edge that completes the cycle. thus, if wait states are inserted in the bus cycle, the sample point is later in the cycle. 2. the sample point at s3 assumes that the required setup time is met, as defined in sec- tion 10 electrical characteristics. 3. if srm is cleared in the cmr (default condition), then donex is synchronized inter- nally before it is used; therefore, donex must be negated one clock earlier than the s3 falling edge to be recognized on that cycle. 4. if the device is configured to be the source and dual address mode, the sample point used by the idma is s5 rather than s3. this gives the user one additional clock to as- sert the donex signal. when the operand transfer has terminated, str is cleared, and a done bit interrupt is gen- erated if the corresponding cmar bit is set. the sapr and/or dapr are also incremented in the normal fashion, and the bcr is decremented. 7.6.4.8.2 auto buffer mode termination. the user can suspend a transfer in auto buffer mode by clearing the str bit in the cmr. when str is set once again, the transfer will con- tinue.
idma channels 7-54 mc68360 user? manual motorola the user can terminate the transfer by setting the rst bit in the cmr and then issuing the init_idma command. the user can terminate the transfer with an "out of buffers" error if the v-bit of one of the bds is cleared by the user. when the risc reaches this idma bd, it will terminate activity. this technique is useful when the idma is required to stop transfers after fully completing a bd transfer. if the bcr is decremented to zero, the transfer from this bd completes, but the risc con- troller reloads the idma registers with the values from the next idma bd, and the idma transfer continues. thus, the fact that the bcr is decremented to zero does not terminate a transfer in auto buffer mode; it only terminates the current bd transfer. if donex is asserted externally, the transmission from this bd is terminated and the follow- ing actions are performed by the risc controller: 1. sets the done bit in the status register 2. sets the da bit in the bd 3. clears the valid bit in the bd 4. resets the start bit in the cmr thus the current buffer is closed immediately and all idma operation ceases. 7.6.4.8.3 buffer chaining mode termination. the user can suspend a transfer in auto buffer mode by clearing the str bit in the cmr. when str is set once again, the transfer will continue. the user can terminate the transfer by setting the rst bit in the cmr and then issuing the init_idma command. the user can also terminate the transfer by setting the l-bit in the idma bd. when process- ing of this bd has completed, the transmission will terminate with the done bit being set in the csr. this can cause an interrupt if the corresponding bit in the cmar is set. if the bcr is decremented to zero, the transfer from this bd completes, but the risc con- troller reloads the idma registers with the values from the next idma bd, and the idma transfer continues. thus, the fact that the bcr is decremented to zero does not terminate a transfer in buffer chaining mode; it only terminates the current bd transfer. if donex is asserted externally, the transmission from this bd is terminated and the follow- ing actions are performed by the risc controller. 1. sets the done bit in the status register 2. sets the abort bit in the bd 3. clears the ready bit in the bd 4. resets the start bit in the cmr 5. sets the reset bit in the cmr
idma channels motorola mc68360 user? manual 7-55 7.6.5 idma examples the following paragraphs provide idma examples. 7.6.5.1 single buffer examples. to see three examples of single buffer operation, see the 7.6.4.6.1 dual address mode. 7.6.5.2 buffer chaining example. ?he following example shows the setup required to initialize idma channel 1 to perform three buffer transfers using the buffer chaining mode. this example will move 16 bytes from address 0 to address $1000, then 16 bytes from address $100 to $1100, and then 16 bytes from address 200 to $1200. 1. initialize basic idma channel 1 registers: 2. iccr = $0720. recommended normal configuration. 3. fcr1 = $89. source function code is 1000; destination function code is 1001. 4. sapr1 not initialized. will be initialized later by risc controller. 5. dapr1 not initialized. will be initialized later by risc controller. 6. bcr1 not initialized. will be initialized later by risc controller. 7. csr1 = $ff. clear any csr bits that are currently set. 8. cmar1 = $00. disable interrupts for this example. 9. cmr1 = $530c. the risc controls the idma activity (rci bit is set). the idma channel uses 12.5% of the bus bandwidth. the source and destination size are long word. do not set the str bit yet. 10. issue the init_idma command to the risc controller. this command is not required unless the idma was reset with the cmr rst bit while in the buffer chaining or auto buffer modes. 11. cr = $0591. issue init_idma command to idma channel 1. 12. initialize the idma channel 1 parameter ram: 13. ibase = $0000. this points the beginning of the idma bds. the value of $0000 means that the first idma bd is located at the beginning of the internal dual-port ram. 14. initialize the first idma bd: 15. bd1_status = $0000. this is offset 0 from the bd. set up all bits except the v-bit. 16. bd1_data_length = $00000010. transfer 16 bytes. 17. bd1_source_pointer = $00000000. source address. 18. bd1_destination_pointer = $00001000. destination address. 19. bd1_status = $8000. set the v-bit. it is good practice to set the v-bit last; however, in this example the idma channel is not yet enabled, so it could have been set earlier. 20. initialize the second idma bd: 21. bd2_status = $0000. this is offset 0 from the bd. set up all bits except the
idma channels 7-56 mc68360 user? manual motorola v-bit. 22. bd2_data_length = $00000010. transfer 16 bytes. 23. bd2_source_pointer = $00000100. source address. 24. bd2_destination_pointer = $00001100. destination address. 25. bd2_status = $8000. set the v-bit. it is good practice to set the v-bit last; however, in this example the idma channel is not yet enabled, so it could have been set earlier. 26. initialize the third idma bd: 27. bd3_status = $2800. this is offset 0 from the bd. set up all bits except the v-bit. in this case, set the l-bit to indicate that the idma should stop after this bd, and set the done bit in the csr. additionally, set the w-bit to cause the risc to point to the first bd when done. the w-bit should always be set in the last bd of the list. 28. bd3_data_length = $00000010. transfer 16 bytes. 29. bd3_source_pointer = $00000200. source address. 30. bd3_destination_pointer = $00001200. destination address. 31. bd3_status = $a800. set the v-bit. it is good practice to set the v-bit last; however, in this example the idma channel is not yet enabled, so it could have been set earlier. 32. start the idma channel: 33. cmr1 = $530d. set the str bit of this register. the idma now begins transferring all three bds. 34. check for successful completion: 35. read the cmr and wait for the str bit to be cleared, indicating the end of the transfer. read the csr to see what status has been set. in this case, only the done bit should be set. the ad bit would only be set if the i-bit of the bd_status field had been set. 7.6.5.3 auto buffer example. the previous buffer chaining example can be easily modified to show the auto buffer operation. simply set the cm bit in the bd_status words of each of the three bds, and for the sake of clarity, clear the l-bit of the third bd. the idma channel will then repeatedly transfer groups of 16 bytes until the str bit is cleared in soft- ware, the idma is reset, or the v-bit is cleared in one of the idma bds. note use of the idma internal maximum rate option in the auto buffer mode is not recommended because the cpu32+ would only be able to execute instructions during the brief period that the risc is configuring the idma channel between bds. these bits must be set to 7 if the quicc is in slave mode.
sdma channels motorola mc68360 user? manual 7-57 7.7 sdma channels fourteen sdma channels are present on the quicc. eight are associated with the four full- duplex sccs. the other six are assigned to the service of the spi and the two smcs. each channel is permanently assigned to service either the receive or transmit operation of an scc, smc, or spi. figure 7-17 shows the paths of the data flow. data from the sccs, smcs, and spi may be routed to the external ram (path 1) or the internal dual-port ram (path 2). in both cases, however, the imb is used for the data transfer. on a path 1 access, the imb and the external system bus must be acquired by the sdma channel. on a path 2 access, only the imb needs to be acquired, and the access will not be seen on the external system bus unless the quicc is configured into the "show cycles" mode of the sim60. thus, the transfer on the imb can occur while other operations occur simultaneously on the external system bus. each sdma channel may be programmed to output one of 16 function codes. the function codes are used to identify the channel that is currently accessing memory. also, the sdma channel may be assigned a big endian (motorola) or little endian format for accessing buffer data. these features are programmed in the receive and transmit function code registers associated with the sccs, smcs, and spi. if a bus error occurs on an access by the sdma, the cpm generates a unique interrupt in the sdma status register. the interrupt service routine then reads the sdma address reg- ister to determine the address on which the bus error occurred. the channel that caused the bus error is determined by reading the rx internal data pointer and tx internal data pointers from the specific protocol parameters area in the parameter ram for the serial channels. if an sdma bus error occurs, all cp activity ceases, and the entire cp must be reset in the command register. 7.7.1 sdma bus arbitration and bus transfers on the quicc, the sdma, idma, and dram refresh controller can become internal bus masters. to determine the relative priority of these masters, each is given an arbitration id. the 14 sdma channels share the same id, which is programmed by the user. therefore, any sdma channel can arbitrate for the bus against the other internal masters and any external masters that are present. once an sdma channel obtains the system bus, it remains the bus master for one long- word transfer before relinquishing the bus. this feature, in combination with the zero clock arbitration overhead provided by the imb, allows the simultaneous benefits of bus efficiency and low bus latency. in the case of character-oriented protocols, the sdma writes characters to memory (it does not wait for multiple characters to be received before writing), but the sdma always reads long words. this is consistent with the goal of providing low-latency operation on character- oriented protocols that tend to be used at slower rates.
sdma channels 7-58 mc68360 user? manual motorola figure 7-17. sdma data paths the read or write operation may take multiple bus cycles if the memory provides less than a 32-bit port size. for instance, a 32-bit long-word read from a 16-bit memory will take two sdma bus cycles. as long as a higher priority bus master does not require the bus during an sdma transfer, the entire operand (32 bits on reads and 8, 16, or 32 bits on writes) will be transferred in back-to-back bus cycles before the sdma relinquishes the bus. if a higher priority bus master requests the bus during an operand transfer, it will be granted the bus at the end of that sdma bus cycle. once the higher priority bus master relinquishes the bus, the sdma will reacquire the bus and continue any outstanding bus cycles. the sdma can steal cycles with no arbitration overhead when the quicc is in master mode (i.e., the cpu32+ is enabled) and the external bus is not currently being held by an external master (see figure 7-18). note that in normal operation, the br , bg , and bgack signals are not affected by the sdma; however, an indication of the sdma internal bus request can be obtained from the bclro signal. the sdma will assert the bclro signal when it requests the bus if this capability is pro- grammed in the sim60 module configuration register and port e pin assignment register. bclro can be used to clear an external bus master from the external bus, if desired. for instance, bclro can be connected through logic to the external master? halt signal, and then be negated externally when the external master? as signal is negated. bclro, as seen from the quicc, is negated by the sdma during its access to memory. 14 sdma channels risc controller 4 sccs 2 smcs 1 spi internal dual-port ram internal imb sim60 cpu32+ core external ram external rom 1 2 quicc serial channel data flow
sdma channels motorola mc68360 user? manual 7-59 figure 7-18. sdma bus arbitration (normal operation) the relative priority between the two idmas and the sdma channels is user programmable. regardless of system configuration, if the idma is a bus master when a higher priority sdma channel needs to transfer over the bus, the sdma will steal cycles from the idma with no arbitration overhead. when the quicc is in slave mode (cpu32+ is disabled) the sdma can steal cycles from the idma with no arbitration overhead. see section 4 bus operation for diagrams of bus arbitration by an internal master in slave mode. 7.7.2 sdma registers the sdma channels have one configuration register; otherwise, they are controlled trans- parently to the user, through the configuration of the sccs, smcs, and spi. the only user- accessible registers associated with the sdma are the sdma configuration register (sdcr), sdma address register (sdar), a read-only register used for diagnostics in case of an sdma bus error, and the sdma status register (sdsr). 7.7.2.1 sdma configuration register (sdcr). the 16-bit sdcr is used to config- ure all 14 sdma channels. it is always readable and writable in the supervisor mode, although writing the sdcr is not recommended unless the cp is disabled. sdcr is cleared at reset. as (output) dsackx (i/o) s0 s2 s4 s0 s2 s4 s0 s2 s4 s0 other cycle other cycle notes: 1. the bclro signal is only asserted if the sdma bus arbitration id is greater than the bclroid2?clroid0 bits in the sim60 module configuration register. 2. the br, bg, and bgack signals are not affected by the sdma bus arbitration process if the cpu32+ is enabled. clko1 sdma read (32 bits) bclro (output) br (input) bg (output) bgack (i/o) sdma internally requests bus negated during final sdma bus cycle
sdma channels 7-60 mc68360 user? manual motorola bits 15, 12, 11, 7, 2?eserved frz1?rz0?reeze these bits determine the action to be taken when the freeze signal is asserted. the sdma negates br and keeps it negated until freeze is negated or a reset occurs. 00 = the sdma channels ignore the freeze signal. 01 = reserved. 10 = the sdma channels freeze on the next bus cycle. 11 = reserved. sism?dma interrupt service mask these bits contain the interrupt service mask. when the interrupt service level on the imb is greater than the interrupt service mask, the sdma relinquishes the bus and negates the internal bus request to the imb until the interrupt level service is less than or equal to the interrupt service mask. note this value should be programmed to 7 for typical user applica- tions. this level gives the sdma channels priority over all inter- rupt handlers. said?dma arbitration id these bits establish bus arbitration priority level among modules that have the capability of becoming bus master. in the quicc, the dram refresh controller, idmas, sdmas, and external bus masters can obtain bus mastership. the sdma channel arbitration id is de- termined by these bits. zero is the lowest priority, and seven is the highest priority. note this value should be programmed to 4 for typical user applica- tions. this value should always be programmed to a value larger than the arbitration ids for the two idma channels. the user must program this field to 7 when the quicc is configured in slave mode. inte?nterrupt error this bit enables the sber status bit in the sdsr. 0 = a zero masks the interrupt generated by the corresponding bit in the sdsr. if a bus error occurs while the sdma is bus master, the channel does not generate an interrupt to the quicc interrupt controller. the sber bit is still set in the sdsr. 1 = if a bus error occurs while the sdma is bus master, the channel generates an in- terrupt to the quicc interrupt controller and sets the sber bit in the sdsr. 1514131211109876543210 frz sism said inte intb
sdma channels motorola mc68360 user? manual 7-61 note an interrupt will only be generated if the sdma bit is set in the cp interrupt mask register. intb?nterrupt breakpoint this bit is the enable bit for the sbkp status bit in the sdsr. 0 = a zero masks the interrupt generated by the corresponding bit in the sdsr. when a breakpoint is recognized while the sdma is bus master, the channel does not generate an interrupt to the quicc interrupt controller. the sbkp bit is still set in the sdsr. 1 = when a breakpoint is recognized while the sdma is bus master, the channel gen- erates an interrupt to the quicc interrupt controller and sets the sbkp bit in the sdsr. note an interrupt will only be generated if the sdma bit is set in the cp interrupt mask register. the interrupt can suspend sdma ac- tivity immediately if it is programmed to be at a higher level than the sdma channels. alternatively, the interrupt can be pro- cessed after the sdma transfer is complete. 7.7.2.2 sdma status register (sdsr). shared by all 14 sdma channels, the sdsr is an 8-bit register used to report events recognized by the sdma controller. on recognition of an event, the sdma sets its corresponding bit in the sdsr (regardless of the inte, intb, and intr bits in the sdcr). the sdsr is a memory-mapped register that may be read at any time. a bit is reset by writing a one and is left unchanged by writing a zero. more than one bit may be reset at a time, and the register is cleared by reset. bits 7??eserved rint?eserved interrupt this status bit is reserved for factory testing. rint is cleared by writing a one; writing a zero has no effect. sber?dma channel bus error this bit indicates that the sdma channel terminated with an error during a read or write cycle. the sdma bus error address can be read from the sdar. sber is cleared by writ- ing a one; writing a zero has no effect. sbkp?dma breakpoint this bit indicates that the breakpoint signal was asserted during an sdma transfer. sbkp is cleared by writing a one; writing a zero has no effect. 7.7.2.3 sdma address register (sdar). the 32-bit read-only sdar shows the sys- tem address that was accessed during an sdma bus error. it is undefined at reset. 76543210 rint sber sbkp
serial interface with time slot assigner 7-62 mc68360 user? manual motorola 7.8 serial interface with time slot assigner the si connects the physical layer serial lines to the four sccs and two smcs (see figure 7-19). in its simplest configuration, the si allows the four sccs and two smcs to be con- nected their own set of individual pins. each scc or smc that connects to the external world in this way is said to connect to an nmsi. in the nmsi configuration, the si provides a flexible clocking assignment for each scc and smc from a bank of external clock pins and/or inter- nal baud rate generators. however, the main feature of the si is its tsa. the tsa allows any combination of sccs and smcs to multiplex their data together on either one or two tdm channels. tdm is used in this manual as the generic term that describes any serial channel that is divided into chan- nels separated by time. common examples of tdms are the t1 lines in japan and the united states and the cept lines in europe. even if the tsa is not used in its intended capacity, it may still be used to generate complex waveforms on four output pins. for instance, these pins can be programmed by the tsa to implement stepper motor control or variable duty cycle and period control on these pins. any programmed configuration may be changed on the fly. 7.8.1 si key features the two major features of the si are the tsa and the nmsi. the tsa contains the following features: can connect to two independent tdm channels. each tdm may be one of the fol- lowing: ?1 or cept line ?cm highway ?sdn primary rate ?sdn basic rate?dl ?sdn basic rate?ci ?ser-defined interfaces independent, programmable transmit and receive routing paths independent transmit and receive frame syncs allowed independent transmit and receive clocks allowed selection of rising/falling clock edges for the frame sync and data bits supports 1 and 2 input clocks (i.e., 1 or 2 clocks per data bit) selectable delay (0? bits) between frame sync and frame start four programmable strobe outputs and two (2 ) clock output pins 1- or 8-bit resolution in routing, masking, and strobe selection supports frames up to 8192 bits long internal routing and strobe selection can be dynamically programmed supports automatic echo and loopback mode for each tdm
serial interface with time slot assigner motorola mc68360 user? manual 7-63 figure 7-19. si block diagram the nmsi contains the following features: each scc and smc can be independently programmed to work with its own set of pins in a nonmultiplexed manner. each scc can have its own set of modem control pins (txd, rxd, tclk, rclk, rts , cts , and cd ). each smc can have its own set of four pins (smtxd, smrxd, clk, and smsyn). each scc and smc can derive clocks externally from a bank of eight clock pins (clk1?lk8) or a bank of four baud rate generators (brg1?rg4). mux scc3 pins to scc3 mux scc2 pins to scc2 mux time slot assigner tdm a&b pins scc4 pins to scc4 imb tx/rx ram control mode register tdm a&b strobes command register status register clock route mux scc1 pins to scc1 mux smc2 pins to smc2 mux smc1 pins to smc1 nonmultiplexed serial interface (nmsi) route ram note: nmsi clocking paths are not shown. tx/rx r clocks t clocks tx/rx r clocks t clocks r sync t sync
serial interface with time slot assigner 7-64 mc68360 user? manual motorola 7.8.2 tsa overview the tsa implements both the internal route selection and time-division multiplexing for mul- tiplexed serial channels. the tsa supports the serial bus rate and format for most standard tdm buses, including the t1 and cept highways, the pcm highway, and the isdn buses in both basic and primary rates. the two popular isdn basic rate buses, idl and gci (also known as iom-2), are supported. an additional level of flexibility is provided by the tsa in that it supports two tdms. it is therefore possible to simultaneously support one t1 line and one cept line, one basic rate and one primary rate isdn channel, etc. tsa programming is completely independent of the protocol used by the scc or smc. for instance, the fact that scc2 may programmed for the hdlc protocol has no impact on the programming of the tsa. the purpose of the tsa is to route the data from the specified pins to the desired scc or smc at the correct time. it is the job of the scc or smc to handle the data it receives. in its simplest mode, the tsa identifies the frame using one sync pulse and one clock signal provided externally by the user. this can be enhanced to allow independent routing of the receive and transmit data on the tdm. additionally, the definition of a time slot need not be limited to 8 bits or even limited to a single contiguous position within the frame. finally, the user may provide separate receive and transmit syncs as well as receive and transmit clocks. these various configurations are illustrated in figure 7-20.
serial interface with time slot assigner motorola mc68360 user? manual 7-65 figure 7-20. various configurations of a single tdm channel quicc slot 3 slot n tdm rx scc2 smc1 slot 3 slot n tdm tx scc2 smc1 simplest tdm example tsa tdm quicc slot 3 slot n tdm rx scc2 smc1 slot 1 slot 2 tdm tx scc2 smc1 more complex tdm example?nique routing tsa tdm quicc tdm rx scc2 smc1 tdm tx scc2 smc1 note: the two shaded areas of scc2 rx are received as one high-speed data stream by scc2 and stored together in the same data buffers. 1 tdm sync 1 tdm clock tsa tdm scc2 scc2 quicc tdm rx scc2 smc1 tdm tx scc2 smc1 most complex tdm example?otally independent rx and tx tdm tx sync tdm tx clock tsa tdm scc2 tdm rx sync tdm rx clock 1 tdm clock 1 tdm sync 1 tdm sync 1 tdm clock even more complex tdm example?ultiple time slots per channel with varying sizes of time slots
serial interface with time slot assigner 7-66 mc68360 user? manual motorola the tsa also allows two tdm channels to be supported simultaneously. thus, in its most flexible mode, the tsa can provide two separate tdm channels, each with an independent receive and transmit routing assignment and independent sync pulse and clock inputs (see figure 7-21). thus, the tsa can support four, independent, half-duplex tdm sources, two in reception and two in transmission, using four sync inputs and four clock inputs. figure 7-21. dual tdm channel example in addition to channel programming, the tsa supports up to four strobe outputs that may be asserted on a bit basis or a byte basis. these strobes are completely independent from the channel routing used by the sccs and smcs. they are useful for interfacing to other devices that do not support the multiplexed interface or for enabling/disabling three-state i/ o buffers in a multi-transmitter architecture. (note that open-drain programming on the txdx pins to support a multi-transmitter architecture is programmed in the parallel i/o block.) these strobes can also be used for generating output waveforms to support such applications as stepper motor control. most tsa programming is accomplished in two si rams, each of size 64 16 bits. these si rams are directly accessible by the host processor in the internal register section of the quicc and are not associated with the dual-port ram. one si ram is always used to pro- quicc tdma rx scc3 smc1 tdma tx scc2 smc1 tdma tx sync tdma tx clock tsa tdma scc2 tdma rx sync tdma rx clock tdmb rx scc2 tdmb tx scc3 tdmb tx sync tdmb tx clock scc4 tdmb rx sync tdmb rx clock tdmb note: sccs may receive on one tdm and transmit on another (e.g., scc2 and scc3).
serial interface with time slot assigner motorola mc68360 user? manual 7-67 gram the transmit routing, and the other si ram is always used to program the receive rout- ing. with the si rams, the user can define the number of bits/bytes that are to be routed to which scc or smc and the times the external strobes are to be asserted and negated. the size of the si ram that is available for time-slot programming depends on the configuration. if two tdm channels are selected, the si ram entries available per channel are reduced by one-half. if on-the-fly changes are also allowed, the si ram entries are further reduced by one-half. even in a configuration with two tdm channels and on-the-fly changes allowed, the si ram size is still sufficient to allow extensive time-slot programming flexibility. the maximum frame length that can be supported in any configuration is 8192 bits. the si supports two testing modes: echo and loopback. echo mode provides a return signal from the physical interface by retransmitting the signal it has received. the physical interface echo mode differs from the individual scc echo mode in that it can operate on the entire tdm signal rather than just on a particular scc channel. loopback mode causes the phys- ical interface to receive the same signal it is transmitting. the si loopback mode checks more than the individual scc loopback; it checks the si and the internal channel routes. the maximum clock that can be input to the tsa depends on the internal syncclk rate. syncclk, which is generated in the quicc clock synthesizer specifically for the sccs, smcs, and tsa, defaults to the system frequency (for instance, 25 mhz). however, the clock synthesizer in the sim60 has an option to divide syncclk by 1, 4, 16, or 64 before it leaves the clock synthesizer. whatever the resulting frequency of syncclk, the maximum external serial clock that may be an input to the tsa is syncclk/2.5. the ability to reduce the frequency of syncclk before it ever leaves the clock synthesizer is useful for two reasons. first, in a low-power mode, the tsa clocking could potentially be a significant factor in overall quicc power consumption. thus, if the tsa does not need to operate at high frequencies, the user may choose a lower frequency syncclk as the input to the tsa. (in making this decision, the user must also consider the needs of the other sccs and smcs not connected to the tsa and select a sufficiently high syncclk value for their use.) second, the user may wish to dynamically change the general system clock fre- quency in the clock synthesizer (slow-go mode) while still having the tsa run at the original frequency. the syncclk also allows this configuration. if an scc or smc is operating with the nmsi, then the serial clock rate may be slightly faster, at a value not to exceed syncclk/2. 7.8.3 enabling connections to the tsa each scc and smc may be independently enabled to be connected to the tsa (see figure 7-22). note that separate bits enable whether each scc or smc is connected to the tsa or to its own set of external pins. additionally, the two tdm interfaces must be enabled to be connected to the tsa.
serial interface with time slot assigner 7-68 mc68360 user? manual motorola figure 7-22. enabling connections through the si once the connections are made, the exact routing decisions are made in the si ram, as described in the following paragraphs. 7.8.4 si ram the si has two 64 16 static rams used to control the routing of the tdm channels to the sccs and smcs. the rams are uninitialized after power-on. for proper operation, the host should program the rams before enabling the multiplexed channels, or undesired results may occur. the ram consists of 16-bit entries that are used to define the routing control. each entry can control from 1 to 16 bits or from 1 to 16 bytes at a time as determined in the entry. in addition to the routing, up to four strobe pins may be asserted according to the programming of the ram. the strobes are active high. the two si rams can be configured in four different ways to support various tdm channels. the four possible cases are discussed in the following paragraphs. si ram tdma pins time slot assigner control logic tdmb pins en en ena = 1 to enable enb = 1 to enable scc 1 scc1 pins sc1 = 1 scc 2 scc2 pins sc2 = 1 scc 3 scc3 pins sc3 = 1 scc 4 scc4 pins sc4 = 1 smc 1 smc1 pins smc1 = 1 smc 2 smc2 = 1 sc1=0 sc2=0 sc3=0 sc4=0 smc1=0 smc2=0 smc2 pins notes: 1. the enx bits are located in sigmr. 2. the scx bits are located in sicr. 3. the smcx bits are located in simode. 4. the clocking paths are not shown for the nonmultiplexed i/f (see figure 7-35 for more details). multiplexed i/f nonmultiplexed i/f
serial interface with time slot assigner motorola mc68360 user? manual 7-69 7.8.4.1 one multiplexed channel with static frames. with this configuration (see figure 7-23), there are 64 entries in the si ram for transmit data and strobe routing and 64 entries for receive data and strobe routing. this configuration should be chosen when only one tdm is required and the routing on that tdm does not need to be changed dynamically. figure 7-23. si ram: one tdm with static frames 7.8.4.2 one multiplexed channel with dynamic frames. with this configura- tion (see figure 7-24), there is one multiplexed channel. the channel has 32 entries for transmit data and strobe routing and 32 entries for receive data and strobe routing. in each ram, one of the partitions is the current-route ram, and the other is a shadow ram used to allow the user to change the serial routing. after programming the shadow ram, the user sets the csrx bit of the associated channel in the si cr. when the next frame sync arrives, the si will automatically exchange the current-route ram for the shadow ram. refer to 7.8.4.7 si ram dynamic changes for more details on how to dynamically change the chan- nel's route. this configuration should be chosen when only one tdm is required but the rout- ing on that tdm may need to be changed dynamically. one channel with independent rx and tx route framing signals rdm = 00 l1rclka l1rsynca si ram address: 0 (16-bits wide) 127 256 128 l1tclka l1tsynca 64 entries rxa route 64 entries txa route
serial interface with time slot assigner 7-70 mc68360 user? manual motorola figure 7-24. si ram: one tdm with dynamic frames 7.8.4.3 two multiplexed channels with static frames. with this configura- tion (see figure 7-25), there are 32 entries for transmit data and strobe routing and 32 entries for receive data and strobe routing. this configuration should be chosen when two tdms are required and the routing on that tdm does not need to be changed dynamically. one channel with shadow ram for dynamic route change rdm = 01 framing signals l1rclka si ram address: 0 (16-bits wide) 63 191 128 192 64 127 255 32 entries rxa route 32 entries txa route l1rsynca l1tclka l1tsynca
serial interface with time slot assigner motorola mc68360 user? manual 7-71 figure 7-25. si ram: two tdms with static frames 7.8.4.4 two multiplexed channels with dynamic frames. with this configu- ration (see figure 7-26), there are two multiplexed channels. each channel has 16 entries for transmit data and strobe routing and 16 entries for receive data and strobe routing. in each ram, one of the partitions is the current-route ram, and the other is a shadow ram used to allow the user to change the serial routing. after programming the shadow ram, the user sets the csrx bit of the associated channel in the si cr. when the next frame sync arrives, the si will automatically exchange the current-route ram for the shadow ram. refer to 7.8.4.7 si ram dynamic changes for more details on how to dynamically change the channel's route. this configuration should be chosen when two tdms are required and the routing on each tdm may need to be changed dynamically. two channels with independent rdm = 10 rx and tx route 32 entries rxa route framing signals l1rclka l1rsynca si ram address: 0 32 entries txa route 63 191 128 l1tclka l1tsynca 32 entries txb route 32 entries rxb route l1rclkb l1rsyncb l1tclkb l1tsyncb 64 127 192 255 (16-bits wide) framing signals
serial interface with time slot assigner 7-72 mc68360 user? manual motorola figure 7-26. two tdms with dynamic frames 7.8.4.5 programming si ram entries. the programming of each word within the ram determines the routing of the serial bits (or bit groups) and the assertion of strobe out- puts. the ram programming codes are as follows: notes: 1: only available on rev c mask or later. not available on rev a or b. rev a mask is c63t rev b mask are c69t, and f35g current rev c mask are e63c, e68c and f15w bit 15 loop (loop back this time slot) 0 = normal mode 1 = loop back mode for this time slot swtr?witch tx and rx the swtr bit is only valid in the receive route ram and is ignored in the transmit route ram. this bit affects the operation of both the l1rxd and l1txd pins the swtr bit would only be set in a special situation where the user desires to receive data from a transmit pin and transmit data on a receive pin. for instance, consider the sit- uation where devices a and b are connected to the same tdm, each with different time slots. normally, there is no opportunity for stations a and b to communicate with each oth- er directly over the tdm, since they both receive the same tdm receive data and transmit on the same tdm transmit signal (see figure 7-27). 1514131211109876543210 loop 1 swtr ssel1?sel4 csel cnt byt lst two channels with shadow ram for dynamic route change rdm = 11 16 entries rxa route framing signals l1rsynca si ram address: 0 (16-bits wide) 30 158 128 160 32 62 190 16 entries rxb route framing signals l1rclkb l1rsyncb 94 222 192 l1tclkb l1tsyncb 224 96 126 254 64 16 entries txa route 16 entries txb route 16 entries rxa route 16 entries rxb route 16 entries txa route 16 entries txb route l1rclka l1tclka l1tsynca
serial interface with time slot assigner motorola mc68360 user? manual 7-73 figure 7-27. using the swtr feature the swtr option gives station b the opportunity to listen to transmissions from station a and to transmit data to station a. to do this, station b would set the swtr bit in its receive route ram. for this entry, receive data is taken from the l1txd pin and data is transmit- ted on the l1rxd pin. if the user only wants to listen to station a? transmissions and not transmit data on l1rxd, then the csel bits in the corresponding transmit route ram en- try should be cleared to prevent transmission on the l1rxd pin. it is also possible for station b to transmit data to station a by setting the swtr bit of the entry in its receive route ram. data is transmitted on the l1rxd pin rather than the l1txd pin, according to the transmit route ram. note that this configuration could cause collisions with other data on the l1rxd pin unless care is taken to choose an available (quiet) time slot. if the user only wants to transmit on l1rxd and not receive data on l1txd, then the csel bits in the receive route ram should be cleared to prevent recep- tion of data on l1txd. note if the transmit and receive sections of the tdm do not use a sin- gle clock source, this feature will give erratic results. 0 = normal operation of the l1txd and l1rxd pins. 1 = data is transmitted on the l1rxd pin and is received from the l1txd pin for the duration of this entry. ssel1?sel4?trobe select the four strobes (l1sta1, l1sta2, l1stb1, and l1stb2) may be assigned to the re- ceive ram and asserted/negated with l1rclka or l1rclkb or assigned to the transmit ram and asserted/negated with l1tclka or l1tclkb. each bit corresponds to the value the strobe should have during this bit/byte group. multiple strobes can be asserted simul- taneously, if desired. if a strobe is configured to be asserted in two consecutive si ram entries, then it will re- main continuously asserted during the processing of both si ram entries. if a strobe is asserted on the last entry in the table, the strobe will be negated after the processing of that last entry is complete. bit 9?eserved rx rx tx tx station a tdm transmit data tdm receive data station b
serial interface with time slot assigner 7-74 mc68360 user? manual motorola notes each strobe is changed with the corresponding ram clock and will be output only if the corresponding parallel i/o is configured as a dedicated pin. if a strobe is programmed to be asserted in more than one set of entries (e.g., the si rx route for the tdma entries and the si tx route for tdmb entries both select the same strobe), then the as- sertion of the strobe corresponds to the logical or of all possible sources. this use of the strobes is not useful for most applica- tions. it is recommended that a given strobe be selected in only one set of si ram entries. csel?hannel select 000 = the bit/byte group is not supported within the quicc. the transmit data pin is three-stated, and the receive data pin is ignored. 001 = the bit/byte group is routed to scc1. 010 = the bit/byte group is routed to scc2. 011 = the bit/byte group is routed to scc3. 100 = the bit/byte group is routed to scc4. 101 = the bit/byte group is routed to smc1. 110 = the bit/byte group is routed to smc2. 111 = the bit/byte group is not supported within the quicc. this code is also used in scit mode as the d channel grant (refer to 7.8.7.2.2 scit programming.) cnt?ount this value indicates the number of bits/bytes (according to the byt bit) that the routing and strobe select of this entry controls. if cnt = 0000, then 1 bit/byte is chosen; if cnt = 1111, then 16 bits/bytes are selected. byt?yte resolution 0 = bit resolution?he cnt value indicates the number of bits in this group. 1 = byte resolution?he cnt value indicates the number of bytes in this group. lst?ast entry in the ram whenever the si ram is used, this bit must be set in one of the tx or rx entries of each group that is used. even if all entries of a group are used, this bit must still be set in the last entry. 0 = this is not the last entry in this section of the route ram. 1 = this is the last entry in this ram. after this entry, the si will wait for the sync signal to start the next frame. note if a second sync signal is received before the end of a frame (as defined by the last si ram entry), an error occurs. the si will ter- minate si ram processing, and cease transmitting or receiving data until a third sync signal is received.
serial interface with time slot assigner motorola mc68360 user? manual 7-75 7.8.4.6 si ram programming example. this example shows how to program the ram to support the 10-bit idl bus (see figure 7-33 for the 10-bit idl bus format). in this example, the tsa supports the b1 channel with scc2, the d channel with scc1, the first 4 bits of the b2 channel with an external device (using a strobe to enable the external device), and the last 4 bits of b2 with scc4. additionally, the tsa will mark the d channel with another strobe signal. first, divide the frame from the start (i.e., the sync) to the end of the frame according to the support that is required: 1. 8 bits (b1)?cc2 2. 1 bit (d)?cc1 + strobe1 3. 1 bit?o support 4. 4 bits (b2)?trobe2 5. 4 bits (b2)?cc4 6. 1 bit (d)?cc1 + strobe1 each of these six divisions can be supported by just one si ram entry. thus, a total of only six entries is needed in the si ram: note since idl requires the same routing for both receive and trans- mit, an exact duplicate of the above entries should be written to both the receive and transmit sections of the si ram. then the crtx bit in the simode register can be used to instruct the si ram to use the same clock and sync to simultaneously control both sets of si ram entries. 7.8.4.7 si ram dynamic changes. the si ram, described in 7.8.4.5 programming si ram entries, has four operating modes: 1. one tdm with a static routing definition. si ram divided into two parts (rx and tx). 2. one tdm allowing dynamic changes. si ram divided into four parts. 3. two tdms with static routing definition. si ram divided into four parts. 4. two tdms allowing dynamic changes. si ram divided into eight parts. entry ram word no. swtr ssel csel cnt byt lst description 1 0 0000 010 0000 1 0 8 bits scc2 2 0 0001 001 0000 0 0 1 bit scc1 strobe1 3 0 0000 000 0000 0 0 1 bit no support 4 0 0010 000 0011 0 0 4 bits strobe2 5 0 0000 100 0011 0 0 4 bits scc4 6 0 0001 001 0000 0 1 1 bit scc1 strobe1
serial interface with time slot assigner 7-76 mc68360 user? manual motorola dynamic changes mean that the routing definition of a tdm can be modified while the sccs/smcs are connected to the tdm. with fixed routing, a change to the routing requires that all sccs/smcs connected to the tsa be disabled, the si routing be modified, and then all sccs/smcs connected to the tsa be reenabled before the new routing takes effect. dynamic changes divide portions of the si ram into current-route ram and shadow ram. once the current-route ram is programmed, the tsa and si channels can be enabled, and tsa operation can begin. when the user decides that a change in routing is required, the user programs the shadow ram with the new route and sets the csrx bit in the si cr. as a result, the si will exchange the shadow ram and the current-route ram as soon as the corresponding sync arrives and will reset the csrx bit to signify that the operation is com- plete. at this time, the user may change the routing again. note that the original current- route ram is now the shadow ram and vice versa. figure 7-28 illustrates an example of the shadow ram exchange process. if one tdm with dynamic changes is programmed, the initial current-route ram addresses in the si ram are as follows: 0?3 rxa route 128?91txa route and the shadow rams are at addresses: 64?27 rxa route 192?55txa route if two tdms with dynamic changes are programmed, the initial current-route ram address- es in the si ram are as follows: 0?1 rxa route 64?3 rxb route 128?59txa route 192?23txb route and the shadow rams are at addresses: 32?3 rxa route 96?3 rxb route 160?91txa route 224?55txb route the user can read any ram at any time, but for proper operation of the si, the user must not attempt to write the current-route ram. the user can read the si status register (sistr) to find which part of the ram is the current-route ram. beyond knowing which ram is the current-route ram, the user may wish to know which entry that the tsa is currently using within the current-route ram. this information is pro- vided in the si ram pointer register (sirp). the user may also externally connect one of the four strobes to an interrupt pin to generate an interrupt on a particular si ram entry start- ing or ending execution by the tsa.
serial interface with time slot assigner motorola mc68360 user? manual 7-77 figure 7-28. si ram dynamic changes 7.8.5 si registers the following paragraphs describe the si registers. 7.8.5.1 si global mode register (sigmr). the 8-bit sigmr defines the ram divi- sion modes. the sigmr appears to the user as a memory-mapped, read-write register and is cleared at reset. bits 7??eserved 7654 3 210 enb ena rdm1?dm0 16 txb shadow 16 rxb shadow 16 rxa route 16 rxb route the tsa uses the first part of the ram, and the shadow is the second part of the ram. csrxn = 0 l1rclkb l1rsyncb framing signals: l1rclka l1rsynca 1) initial state 16 rxa shadow 0 31 32 63 64 95 96 127 csrra = 0 the user programs the shadow ram for the new rx and tx route and sets csrxn. 1) programming the si exchanges between the shadow ram and the current- route ram and resets csrxn. 1) exchange 16 txa route 16 txb route l1tclkb l1tsyncb framing signals: l1tclka l1tsynca 16 txa shadow 128 159 160 191 192 223 224 255 16 rxa route 16 rxb route l1rclkb l1rsyncb l1rclka l1rsynca 16 rxa shadow 16 rxb shadow 0 31 32 63 64 95 96 127 16 txa route 16 txb route l1tclkb l1tsyncb l1tclka l1tsynca 16 txa shadow 16 txb shadow 128 159 160 191 192 223 224 255 16 rxa shadow 16 rxb shadow l1rclkb l1rsyncb framing signals: l1rclka l1rsynca 16 rxa route 16 rxb route 031326364 95 96 127 16 txa shadow l1tclkb l1tsyncb l1tclka l1tsynca 16 txb shadow 16 txa route 16 txb route 128 159 160 191 192 223 224 255 ram address: ram address: ram address: ram address: ram address: ram address: csrta = 0 csrrb = 0 csrtb = 0 csrra = 1 csrta = 1 csrrb = 1 csrtb = 1 csrra = 0 csrta = 0 csrrb = 0 csrtb = 0 framing signals: framing signals: framing signals:
serial interface with time slot assigner 7-78 mc68360 user? manual motorola enb?nable channel b 0 = channel b is disabled. the si rams and tdm routing are in a state of reset, but all other si functions still operate. 1 = the si is enabled. ena?nable channel a 0 = channel a is disabled. the si rams and tdm routing are in a state of reset, but all other si functions still operate. 1 = the si is enabled. rdm1?dm0?am division mode these bits define the ram division mode and the number of multiplexed channels sup- ported in the si. 00 = the si supports one tdm channel with 64 entries for receive routing and 64 en- tries for transmit routing. 01 = the si supports one tdm channel with 32 entries for receive routing and 32 en- tries for transmit routing. there are an additional 32 shadow entries for the receive routing and 32 shadow entries for transmit routing that may be used to dynami- cally change the routing. 10 = the si supports two tdm channels with 32 entries for the receive routing and 32 entries for transmit routing for each of the two tdms. 11 = the si supports two tdm channels with 16 entries for receive routing and 16 en- tries for transmit routing for each channel. there are an additional 16 shadow en- tries for receive routing and 16 shadow entries for transmit routing that may be used to dynamically change the channel routing. note tsaa must be used in rdm1? if 00 or 01 setting is desired. 7.8.5.2 si mode register (simode). the 32-bit simode defines the si operation modes. this register allows the user (in conjunction with the si ram) to support any or all of the isdn channels independently when in idl or gci (iom-2) mode. any extra scc channel can then be used for other purposes in nmsi mode. simode appears to the user as a memory-mapped, read-write register and is cleared at reset. smcx?mcx connection 0 = nmsi mode. the clock source is determined by the smcxcs bit, and the data comes from a dedicated pin (smtxd1 and smrxd1 for smc1 or smtxd2 and smrxd2 for smc2) in the nmsi. 1 = smcx is connected to the multiplexed si (tdm channel). 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 smc2 smc2cs sdmb rfsdb dscb crtb stzb ceb feb gmb tfsdb 1514131211109876543210 smc1 smc1cs sdma rfsda dsca crta stza cea fea gma tfsda
serial interface with time slot assigner motorola mc68360 user? manual 7-79 smc2cs?mc2 clock source (nmsi mode) smc2 can take its clocks from one of the baud rate generators or one of four pins from the bank of clocks. the smc2 transmit and receive clocks must be the same when it is connected to the nmsi. 000 = smc2 transmit and receive clocks are brg1. 001 = smc2 transmit and receive clocks are brg2. 010 = smc2 transmit and receive clocks are brg3. 011 = smc2 transmit and receive clocks are brg4. 100 = smc2 transmit and receive clocks are clk5. 101 = smc2 transmit and receive clocks are clk6. 110 = smc2 transmit and receive clocks are clk7. 111 = smc2 transmit and receive clocks are clk8. smc1cs?mc1 clock source (nmsi mode) smc1 can take its clocks from one of the baud rate generators or one of four pins from the bank of clocks. the smc1 transmit and receive clocks must be the same when it is connected to the nmsi. 000 = smc1 transmit and receive clocks are brg1. 001 = smc1 transmit and receive clocks are brg2. 010 = smc1 transmit and receive clocks are brg3. 011 = smc1 transmit and receive clocks are brg4. 100 = smc1 transmit and receive clocks are clk1. 101 = smc1 transmit and receive clocks are clk2. 110 = smc1 transmit and receive clocks are clk3. 111 = smc1 transmit and receive clocks are clk4. sdmx?i diagnostic mode for tdm a or b 00 = normal operation. 01 = automatic echo. in this mode, the channel_x transmitter automatically retransmits the tdm received data on a bit-by-bit basis. the receive section operates normal- ly, but the transmit section can only retransmit received data. in this mode, the l1grx line is ignored. 10 = internal loopback. in this mode, the tdm transmitter output is internally connect- ed to the tdm receiver input (l1txdx is connected to l1rxdx). the receiver and transmitter operate normally. the data appears on the l1txdx pin. in this mode, the l1rqx line is asserted normally. the l1grx line is ignored. 11 = loopback control. in this mode, the tdm transmitter output is internally connect- ed to the tdm receiver input (l1txdx is connected to l1rxdx). the transmitter output (l1txdx) and the l1rqx pin will be inactive. this mode is used to accom- plish loopback testing of the entire tdm without affecting the external serial lines. note in modes 01,10, and 11, the receive and the transmit clocks should be identical.
serial interface with time slot assigner 7-80 mc68360 user? manual motorola rfsdx?eceive frame sync delay for tdm a or b these two bits determine the number of clock delays between the receive sync and the first bit of the receive frame. even if the crtx bit is set, these bits do not control the delay for the transmit frame. 00 = no bit delay (the first bit of the frame is transmitted/received on the same clock as the sync; use for gci.) 01 = 1-bit delay (use for idl.) 10 = 2-bit delay 11 = 3-bit delay refer to figure 7-29 and figure 7-30 for an example of the use of these bits. dscx?ouble-speed clock for tdm a or b some tdms such as gci define the input clock to be 2 faster than the data rate. this bit controls this option. 0 = the channel clock (l1rclkx and/or l1tclkx) is equal to the data clock. (use for idl and most tdm formats.) 1 = the channel clock rate is twice the data rate. (use for gci.) crtx?ommon receive and transmit pins for tdm a or b this bit is useful when the transmit and receive sections of a given tdm use the same clock and sync signals. in this mode, l1tclkx and l1tsyncx pins can be used as gen- eral-purpose i/o pins. 0 = separate pins. the receive section of this tdm uses l1rclkx and l1rsyncx pins for framing, and the transmit section uses l1tclkx and l1tsyncx for fram- ing. 1 = common pins. the receive and transmit sections of this tdm use l1rclkx as clock pin of channel x and l1rsyncx as the receive and transmit sync pin. (use for idl and gci.) stzx?et l1txdx to zero for tdm a or b 0 = normal operation. 1 = l1txdx is set to zero until serial clocks are available, which is useful for gci acti- vation. refer to 7.8.7.1 si gci activation/deactivation procedure. cex?lock edge for tdm a or b when dscx =0 0 = the data is transmitted on the rising edge of the clock and received on the falling edge. (use for idl and gci.) 1 = the data is transmitted on the falling edge of the clock and received on the rising edge. when dscx = 1 0 = the data is transmitted on the rising edge of the clock and received on the rising edge. (use for idl and gci.) 1 = the data is transmitted on the falling edge of the clock and received on the falling edge.
serial interface with time slot assigner motorola mc68360 user? manual 7-81 fex?rame sync edge for tdm a or b the l1rsyncx and l1tsyncx pulses are sampled with the falling/rising edge of the channel clock according to this bit. 0 = falling edge (use for idl and gci.) 1 = rising edge gmx?rant mode for tdm a or b 0 = gci/scit mode. the gci/scit d channel grant mechanism for transmission is in- ternally supported. the grant is one bit from the receive channel. this bit is marked by programming the channel select bits of the si ram with 111 to assert an internal strobe on it. refer to 7.8.7.2.2 scit programming. 1 = idl mode. a grant mechanism is supported if the corresponding gr1?r4 bits in the simode register are set. the grant is a sample of the l1grx pin while l1tsyncx is asserted. this grant mechanism implies the idl access controls for transmission on the d channel. refer to 7.8.6.2 idl interface programming. tfsdx?ransmit frame sync delay for tdm a or b these two bits determine the number of clock delays between the transmit sync and the first bit of the transmit frame. if the crtx bit is set (recommended with idl or gci), then the transmit sync is not used, and these bits are ignored. 00 = no bit delay (the first bit of the frame is transmitted/received on the same clock as the sync.) 01 = 1 bit delay 10 = 2 bit delay 11 = 3 bit delay refer to figure 7-29 and figure 7-30 for an example of the use of these bits. figure 7-29. one clock delay from sync to data (rfsd = 01) l1clk end of frame l1sync data (fe = 1) (ce = 0) one clock delay from sync latch to first bit of frame bit 0 bit 0 bit 1 bit 2 bit 3 bit 4 bit 5
serial interface with time slot assigner 7-82 mc68360 user? manual motorola figure 7-30. no delay from sync to data (rfsd = 00) l1clk l1sync data bit 0 bit 1 bit 2 bit 3 bit 0 bit 1 bit 2 bit 4 no delay from sync latch to first bit of frame (fe = 1) (ce = 0)
serial interface with time slot assigner motorola mc68360 user? manual 7-83 sfd=1 ce=1 l1clk l1sync (fe=0) l1txd (bit 0) l1st (on bit 0) l1sync (fe=1) ce=0 l1clk l1sync (fe=0) l1txd (bit 0) l1st (on bit 0) l1sync (fe=1) rx sampled here rx sampled here l1st driven from clock hi for both fe settings l1st is driven from clock lo in both the fe settings
serial interface with time slot assigner 7-84 mc68360 user? manual motorola sfd=0 ce=1 l1clk l1sync (fe=0) l1txd (bit 0) l1st (on bit 0) rx sampled here l1sync (fe=0) l1txd (bit 0) l1st (on bit 0) l1sync (fe=1) l1txd (bit 0) l1st (on bit 0) rx sampled here l1sync (fe=1) l1txd (bit 0) l1st (on bit 0) the l1st is driven from sync. both data bit 0 and l1st are driven from sync l1st and data bit 0 data is driven from clock lo. l1st is driven from clock hi is driven from clock lo
serial interface with time slot assigner motorola mc68360 user? manual 7-85 ce=0 l1clk l1sync (fe=1) l1txd (bit 0) l1st (on bit 0) sfd=0 l1sync (fe=1) l1txd (bit 0) l1st (on bit 0) rx sampled here l1sync (fe=0) l1txd (bit 0) l1st (on bit 0) l1sync (fe=0) l1txd (bit 0) l1st (on bit 0) l1st driven from clock lo both the data and l1st from sync both the data and l1st from the clock l1st driven from sync data driven from clock hi. when asserted during clock hi when asserted during clock lo
serial interface with time slot assigner 7-86 mc68360 user? manual motorola 7.8.5.3 si clock route register (sicr). the 32-bit sicr is used to define the scc clock sources. the clock source can be one of the four baud rate generators or an input from a bank of clock pins. the sicr appears to the user as a memory-mapped, read-write reg- ister and is cleared at reset. grx?rant support of sccx 0 = sccx transmitter does not support the grant mechanism. the grant is always as- serted internally. 1 = sccx transmitter supports the grant mechanism as determined by the gmx bit of its channel. scx?ccx connection 0 = sccx is not connected to the multiplexed si but is either connected directly to the nmsix pins or is not used. the choice of general-purpose i/o port pins versus sccn pins is made in the parallel i/o control register. 1 = sccx is connected to the multiplexed si. the nmsix receive pins are available for other purposes. rxcs?eceive clock source for sccx these bits are ignored when the sccx is connected to the tsa (scx = 1). 000 = sccx receive clock is brg1. 001 = sccx receive clock is brg2. 010 = sccx receive clock is brg3. 011 = sccx receive clock is brg4. 100 = sccx receive clock for x = 1,2 is clk1 and for x = 3,4 is clk5. 101 = sccx receive clock for x = 1,2 is clk2 and for x = 3,4 is clk6. 110 = sccx receive clock for x = 1,2 is clk3 and for x = 3,4 is clk7. 111 = sccx receive clock for x = 1,2 is clk4 and for x = 3,4 is clk8. txcs?ransmit clock source for sccx these bits are ignored when sccx is connected to the tsa (scx = 1). 000 = sccx transmit clock is brg1. 001 = sccx transmit clock is brg2. 010 = sccx transmit clock is brg3. 011 = sccx transmit clock is brg4. 100 = sccx transmit clock for x = 1,2 is clk1 and for x = 3,4 is clk5. 101 = sccx transmit clock for x = 1,2 is clk2 and for x = 3,4 is clk6. 110 = sccx transmit clock for x = 1,2 is clk3 and for x = 3,4 is clk7. 111 = sccx transmit clock for x = 1,2 is clk4 and for x = 3,4 is clk8. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 gr4 sc4 r4cs t4cs gr3 sc3 r3cs t3cs 1514131211109876543210 gr2 sc2 r2cs t2cs gr1 sc1 r1cs t1cs
serial interface with time slot assigner motorola mc68360 user? manual 7-87 7.8.5.4 si command register (sicmr). the 8-bit sicmr allows the user to dynami- cally program the si ram. for more information about dynamic programming, refer to 7.8.4.7 si ram dynamic changes the contents of this register are valid only in the ram division mode (rdm1?dm0 bits in sigmr equal 01 or 11). this register is cleared at reset. csrrx?hange shadow ram for tdm a or b receiver when set, this bit will cause the si receiver to replace the current route with the shadow ram. the bit is set by the user and cleared by the si. 0 = the receiver shadow ram is not valid. the user can write into the shadow ram to program a new routing. 1 = the receiver shadow ram is valid. the si will exchange between the rams and take the new receive routing from the receiver shadow ram. this bit is cleared as soon as the switch has completed. csrtx?hange shadow ram for tdm a or b transmitter when set, this bit will cause the si transmitter to replace the current route with the shadow ram. the bit is set by the user and cleared by the si. 0 = the transmitter shadow ram is not valid. the user can write into the shadow ram to program a new routing. 1 = the transmitter shadow ram is valid. the si will exchange between the rams and take the new transmitter routing from the receiver shadow ram. this bit is cleared as soon as the switch has completed. bits 3??eserved these bits should be set to zero by the user. 7.8.5.5 si status register (sistr). the 8-bit sistr indicates to the user which part of the si ram is the current-route ram. the value of this register is valid only when the cor- responding bit in the sigmr is clear. this register is cleared at reset. crora?urrent route of tdma receiver 0 = the current-route receiver ram is in address: 0?3 when the si supports one tdm (rdm = 01) 0?1 when the si supports two tdms (rdm = 11) 1 = the current route receiver ram is in address: 64?27 when the si supports one tdm (rdm = 01) 32?3 when the si supports two tdms (rdm = 11) 76543210 csrra csrta csrrb csrtb 76543210 crora crota crorb crotb
serial interface with time slot assigner 7-88 mc68360 user? manual motorola crota?urrent route of tdma transmitter 0 = the current-route transmitter ram is in address: 128?91 when the si supports one tdm (rdm = 01). 128?59 when the si supports two tdms (rdm = 11). 1 = the current-route transmitter ram is in address: 192?55 when the si supports one tdm (rdm = 01). 160?91 when the si supports two tdms (rdm = 11). crorb?urrent route of tdmb receiver this bit is valid only in the ram division mode (rdm bits in the sigmr equal 11). 0 = the current-route receiver ram is in address 64?5. 1 = the current-route receiver ram is in address 96?27. crotb?urrent route of tdmb transmitter this bit is valid only in the ram division mode (rdm bits in the sigmr equal 11). 0 = the current-route transmitter ram is in address 192?23. 1 = the current-route transmitter ram is in address 224?55. bits 3??eserved 7.8.5.6 si ram pointers (sirp). this 32-bit, read-only register indicates to the user which ram entry is currently being serviced. this gives a real-time status of where the si current is inside the tdm frame. although sirp does not need to be accessed by most users, it does provide information that may be helpful for debugging and synchronization of some system activity to the activity on the tdms. reading sistr should be sufficient for most applications. the user can determine which ram entry in the si ram is currently in progress, but cannot determine the status within that entry. for instance, if the ram entry is programmed to select four contiguous time slots from the tdm and the sirp indicates the entry is currently active, the user does not know which of the four time slots is currently in progress. the sirp will, however, change its status immediately when the next si ram entry begins to be pro- cessed. note the user may also connect one of the four strobes externally to an interrupt pin to generate an interrupt on a particular si ram entry starting or ending execution by the tsa. the value of this register is changed upon transitions of the serial clocks. before acting on the information in this register, the user should perform two reads and verify that the two reads returned the same value.
serial interface with time slot assigner motorola mc68360 user? manual 7-89 the pointers provided by this register indicate the si ram entry word offset that is currently in progress. the register is cleared at reset. in all cases, the value in the txptr or rxptr increments by one for each entry (i.e., 16-bit si ram word) that is processed by the si. since each txptr and rxptr is 5 bits each, the values in each txptr and rxptr can range from 0 to 31, corresponding to 32 different si ram entries. the full pointer range may not necessarily be used. for instance, if the last bit is set in the fifth si ram entry, then the pointer will only reflect values from 0 to 4. once the fifth entry is processed by the si, the pointer is reset to 0. the v-bit in each entry shows that the entry is valid. this information is particularly useful if the ptr value happens to be zero. additionally, the v-bits save the user from having to read both the sirp and the sistr to obtain the needed information. the pointer values are described based on the four possible ways the si ram can be con- figured. 7.8.5.6.1 sirp when rdm = 00 (one static tdm). ?n this case, since 64 entries cannot be signified with a single 5-bit pointer, two 5-bit pointers are used?ne for the first 32 entries and one for the second 32 entries. raptr and rbptr contain the address of the ram entry currently active. when the si services entries 1?2, raptr will be incremented, and rbptr will be continuously cleared. when the si services entries 33?4, raptr will be continuously cleared, and rbptr will be incremented. taptr and tbptr contain the address of the tx entry currently active. when the si ser- vices entries 1?2, taptr will be incremented, and tbptr will be continuously cleared. when the si services entries 33?4, taptr will be continuously cleared, and tbptr will be incremented. 7.8.5.6.2 sirp when rdm = 01 (one dynamic tdm). ?or the receiver, either raptr or rbptr is used, depending on which portion of the si rx ram is currently active. for the transmitter, either taptr or tbptr is used, depending on which portion of the si tx ram is currently active. if its v-bit is set, raptr contains the address of the rx entry currently active. the si ram receive address block in use is 0?3, and crora = 0 in sistr. if its v-bit is set, rbptr contains the address of the rx entry currently active. the si ram receive address block in use is 64?27, and crora = 1 in sistr. if its v-bit is set, taptr contains the address of the tx entry currently active. the si ram transmit address block in use is 128?91, and crota = 0 in sistr. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 v rbptr v raptr 1514131211109876543210 v tbptr v taptr
serial interface with time slot assigner 7-90 mc68360 user? manual motorola if its v-bit is set, tbptr contains the address of the tx entry currently active. the si ram transmit address block in use is 192?55, and crota = 1 in sistr. 7.8.5.6.3 sirp when rdm = 10 (two static tdms). ?his is the simplest case, since each pointer is continuously used and has only one function. raptr contains the address of the rxa entry currently active. rbptr contains the address of the rxb entry currently active. taptr contains the address of the txa entry currently active. tbptr contains the address of the txb entry currently active. 7.8.5.6.4 sirp when rdm = 11 (two dynamic tdms). ?n this case, each pointer is con- tinuously used, but points to different sections of the si ram, depending on whether the pointer? value is in the first half (0?5) or the second half (16?1). raptr contains the address of the rxa entry currently active. if the pointer has a value from 0?5, the current-route ram is si ram address block 0?1, and crora = 0 in sis- tr. if the pointer has a value from 16?1, the current-route ram is si ram address block 32?3, and crora = 1 in sistr. rbptr contains the address of the rxb entry currently active. if the pointer has a value from 0?5, the current route ram is si ram address block 64?5, and crorb = 0 in sis- tr. if the pointer has a value from 16?1, the current-route ram is si ram address block 96?27, and crorb = 1 in sistr. taptr contains the address of the txa entry currently active. if the pointer has a value from 0?5, the current route ram is si ram address block 128?59, and crota = 0 in sistr. if the pointer has a value from 16?1, the current-route ram is si ram address block 160?91, and crota = 1 in sistr. tbptr contains the address of the txb entry currently active. if the pointer has a value from 0?5, the current-route ram is si ram address block 192?23, and crotb = 0 in sistr. if the pointer has a value from 224?55, the current-route ram is si ram address block 160?91, and crotb = 1 in sistr. 7.8.6 si idl interface support the idl interface is a full-duplex isdn interface used to connect a physical layer device to the quicc. the quicc supports both the basic rate and the primary rate of the idl bus. in the basic rate of idl, data on three channels, b1, b2, and d, is transferred in a 20-bit frame, providing 160-kbps full-duplex bandwidth. the quicc is an idl slave device that is clocked by the idl bus master (physical layer device) and has separate receive and transmit sec- tions. because the quicc can support two tdms, it can actually support two independent idl buses using separate clocks and sync pulses as shown in figure 7-31.
serial interface with time slot assigner motorola mc68360 user? manual 7-91 figure 7-31. dual idl bus application example 7.8.6.1 idl interface example. an example of the idl application is the isdn termi- nal adaptor shown in figure 7-32. in such an application, the idl interface is used to connect the 2b+d channels between the quicc, codec, and s/t transceiver. one of the quicc sccs would be configured to hdlc mode to handle the d channel; another quicc scc would be used to rate adapt the terminal data stream over the first b channel. that scc would be configured for hdlc mode if v.120 rate adaption is required. the second b chan- nel could be routed to the codec as a digital voice channel, if desired. the spi is used to send initialization commands and periodically check status from the s/t transceiver. the scc connected to the terminal would be configured for uart or other protocol depending on the terminal protocol used. alternatively, instead of a terminal, a connection to a lan could be made via ethernet. quicc s/t s/t u u s/t idl1 s/t interfaces idl2 isdn te nt u interfaces s/t
serial interface with time slot assigner 7-92 mc68360 user? manual motorola figure 7-32. idl terminal adapter four wire b1 + b2 + d b2 + d scc b1 mc68360 quicc system bus (rom and ram) mc145474 s/t transceiver pots mc145554 pcm codec/filter monocircuit idl (data) icl (control) scc scc tsa scc1 async ethernet mc68160 eest lan spi
serial interface with time slot assigner motorola mc68360 user? manual 7-93 the quicc can identify and support each idl channel or can output strobe lines for inter- facing devices that do not support the idl bus. the idl signals for each transmit and receive channel are as follows: 1. l1rclkx?dl clock; input to the quicc. 2. l1rsyncx?dl sync signal; input to the quicc. this signal indicates that the clock periods following the pulse designate the idl frame. 3. l1rxdx?dl receive data; input to the quicc. valid only for the bits that are supported by the idl; ignored for other signals that may be present. 4. l1txdx?dl transmit data; output from the quicc. valid only for the bits that are supported by the idl; three-stated otherwise. 5. l1rqx?dl request permission to transmit on the d channel; output from the quicc on l1rqx pin. 6. l1grx?dl grant permission to transmit on the d channel; input to the quicc on l1tsyncx pin. note x = a and b for tdma and tdmb. the basic rate idl bus has three channels: b1?4 kbps bearer channel b2?4 kbps bearer channel d?6 kbps signaling channel there are two definitions of the idl bus frame structure: 8 bits and 10 bits (see figure 7-33). the difference between them is only the channel order within the frame. note previous versions of motorola? idl-defined bit functions, called auxiliary (a) and maintenance (m), were eliminated from the idl definition when it was decided that the idl control channel would be out-of-band. they were defined as a subset of the motorola spi format called serial control port (scp). if a user wishes to implement the a and m bit functions as originally defined, the tsa may be programmed to access these bits and to route them transparently to an scc or smc. to perform the out-of-band signaling required, the quicc? spi may be used. the quicc supports all channels of the idl bus in the basic rate. each bit in the idl frame can be routed to every scc and smc or can assert a strobe output for supporting an exter- nal device.
serial interface with time slot assigner 7-94 mc68360 user? manual motorola figure 7-33. idl bus signals the quicc supports the request-grant method for contention detection on the d channel of the idl basic rate. when the quicc has data to transmit on the d channel, it asserts l1rqx. the physical layer device monitors the physical layer bus for activity on the d chan- nel and indicates that the channel is free by asserting l1grx. the quicc samples the l1grx signal when the idl sync signal (l1rsyncx) is asserted. if l1grx is high (active), the quicc transmits the first zero of the opening flag in the first bit of the d channel. if a collision is detected on the d channel, the physical layer device negates l1grx. the quicc then stops its transmission and retransmits the frame when l1grx is reasserted. this pro- cedure is handled automatically for the first two buffers of a frame. for the primary rate idl, the quicc can support up to four 8-bit channels in the frame, determined by the programming of the si ram. to support more channels, the user can route more than one channel to every scc, which the scc will treat as one high-speed stream and store in the same data buffers (this approach is appropriate only for transparent data). additionally, the quicc can be used to assert strobes for support of additional idl channels externally. the idl interface supports the ccitt i.460 recommendation for data rate adaptation, since it can separately access each bit of the idl bus. the current-route ram specifies which bits are supported by the idl interface and by which serial controller. the receiver will receive only the bits that are enabled by the receiver route ram. the transmitter will transmit only l1clk l1sync l1rxd note: l1rqx and l1grx are not shown. b1 d1 b2 d2 l1clk l1sync l1rxd b1 b2 d1 d2 l1txd l1txd b1 d1 b2 d2 b1 b2 d1 d2 (clock not to scale) (clock not to scale) 8-bit idl 10-bit idl
serial interface with time slot assigner motorola mc68360 user? manual 7-95 the bits that are enabled by the transmitter route ram and will three-state l1txdx other- wise. 7.8.6.2 idl interface programming. the user can program the channels used for the idl bus interface to the appropriate configuration. first, the user should program the simode to the idl grant mode for that channel, using the gmx bits. the user can program more than one channel to interface to the idl bus. if the receive and transmit section are used for interfacing to the same idl bus, the user can internally connect the receive clock and sync signals to the si ram transmit section, using the crtx bits. the user has to pro- gram the ram section used for the idl channels to the desired routing. (an example is shown in 7.8.4.6 si ram programming example.) the user should then define the idl frame structure to be a delay of 1 bit from frame sync to data, to falling edge sample sync, and the clock edge to transmit on the rising edge of the clock. the l1txdx pin should be programmed to be three-stated when inactive (through the parallel i/o open-drain register). to support the d channel, the user must program the appropriate grx bit in simode and program the ram entry to route data to that serial controller. the two definitions of idl, 8 bits and 10 bits, are supported by only modifying the si ram programming. in both cases, the l1grx pin will be sampled with the l1tsyncx signal and transferred to the d channel scc as a grant indication. the same procedure is valid for supporting an idl bus in the sec- ond channel. for example, assuming the 7.8.4.6 si ram programming example, which uses scc1, scc2, and scc4, connected to the tdmx pins, with no other sccs connected, the initial- ization sequence is as follows: 1. program the si ram. write all entries that are not used with $0001, setting the lst bit and disabling the routing function. note since idl requires the same routing for both receive and trans- mit, an exact duplicate of the above entries should be written to both the receive and transmit sections of the si ram beginning at si ram addresses 0 and 128, respectively. 2. simode = $00000145. only tdma is used; the smcs are not connected. 3. sicr = $400040c0. only scc4, scc2, and scc1 are connected to the tsa. scc1 supports the grant mechanism since it is on the d channel. 4. paodr bit 6 = 1. configures l1txda to an open-drain output. entry ram word no. swtr ssel csel cnt byt lst description 1 0 0000 010 0000 1 0 8 bits scc2 2 0 0000 001 0000 0 0 1 bit scc1 3 0 0000 000 0000 0 0 1 bit no support 4 0 0000 100 0000 1 0 8 bits scc4 5 0 0001 001 0000 0 1 1 bit scc1 strobe1
serial interface with time slot assigner 7-96 mc68360 user? manual motorola 5. papar bits 6, 7, and 8 = 1. configures l1txda, l1rxda, and l1rclka. 6. padir bits 6 and 7 = 1. padir bit 8 = 0. configures l1txda, l1rxda, and l1rclka. 7. pcpar bits 3, 10, and 11 = 1. configures l1rqa, l1tsynca, and l1rsynca. 8. pcdir bit 3 = 0. l1rqa is an input. l1tsynca will perform the l1gra function and is therefore an output, but it does not need to be configured with a pcdir bit. l1rsynca is an input, but it does not need to be configured with a pcdir bit. 9. sigmr = $04. enable tdma (one static tdm). 10. 1sicmr is not used. 11. 1sistr and sirp do not need to be read, but can be used for debugging information once the channels are enabled. 12. 1enable the scc1 for hdlc operation (to handle the lapd protocol of the d channel), and set scc2 and scc4 as desired. 7.8.7 si gci support the normal mode of the gci, also known as the isdn-oriented modular rev 2.2 (iom-2), and the scit are fully supported by the quicc. the quicc also supports the d channel access control in s/t interface terminals by using the command/indication (c/i) channel for that function. the gci bus consists of four lines: two data lines, a clock, and a frame synchronization line. usually, an 8-khz frame structure defines the various channels within the 256-kbps data rate. the quicc can support two independent gci buses and has independent receive and transmit sections for each one. the interface can also be used in a multiplexed frame struc- ture on which up to eight physical layer devices multiplex their gci channels. in this mode, the data rate would be 2048 kbps. in the gci bus, the clock rate is twice the data rate. the si divides the input clock by two to produce the data clock. the quicc also has data strobe lines, and the 1 data rate clock l1clkox output pins. these signals are used for interfacing devices to gci that do not support the gci bus. the gci signals for each transmit and receive channel are as follows: l1rsyncx?sed as gci sync signal; input to the quicc. this signal indicates that the clock periods following the pulse designate the gci frame. l1rclkx?sed as gci clock; input to the quicc. the l1rclkx signal is twice the data clock. l1rxdx?sed as gci receive data; input to the quicc. l1txdx?sed as gci transmit data; open-drain output. valid only for the bits that are supported by the idl; three-stated otherwise. l1clkox?ptional signal; output from quicc. this 1 clock output can be used to clock devices that do not interface directly to gci. if the double-speed clock
serial interface with time slot assigner motorola mc68360 user? manual 7-97 is used, (dscx bit is set in the simode), this output is the l1rclkx divided by 2; otherwise, it is simply a 1 output of the l1rclkx signal. note that on the mc68302 this signal was known as gcidcl. note x = a and b for tdma and tdmb. figure 7-34 shows the gci bus signals. figure 7-34. gci bus signals in addition to the 144-kbps isdn 2b+d channels, the gci provides five channels for main- tenance and control functions: b1?4 kbps bearer channel b2?4 kbps bearer channel m?4 kbps monitor (m) channel d?6 kbps signaling channel c/i?8 kbps c/i channel (includes a and e bits) the m channel is used to transfer data between layer 1 devices and the control unit (i.e., the cpu32+ core). the c/i channel is used to control activation/deactivation procedures or to switch test loops by the control unit. the m and c/i channels of the gci bus should be routed to smc1 or smc2, which have modes to support the m and c/i channel protocols. the quicc can support any channel of the gci bus in the primary rate by modifying the si ram programming. the gci supports the ccitt i.460 recommendation as a method for data rate adaptation, since it can access each bit of the gci separately. the current-route ram specifies which bits are supported by the interface and by which serial controller. the receiver will receive only the bits that are enabled by the si ram. the transmitter will transmit only the bits that l1clk l1sync (2x the data rate) (clock not to scale) l1rxd l1txd note: l1clkox is not shown. monitor monitor b2 b1 d1 d2 c/i a e a e c/i b2 b1 d1 d2
serial interface with time slot assigner 7-98 mc68360 user? manual motorola are enabled by the si ram and will not drive l1txdx; otherwise, l1txdx is an open-drain output and should be pulled high externally. the quicc supports contention detection on the d channel of the scit bus. when the quicc has data to transmit on the d channel, it checks a scit bus bit that is marked with a special route code (generally, bit 4 of c/i channel 2). the physical layer device monitors the physical layer bus for activity on the d channel and indicates on this bit that the channel is free. if a collision is detected on the d channel, the physical layer device sets bit 4 of c/i channel 2 to logic high the quicc then aborts its transmission and retransmits the frame when this bit is set again. this procedure is handled automatically for the first two buffers of a frame. 7.8.7.1 si gci activation/deactivation procedure. in the deactivated state, the clock pulse is disabled and the data line is at a logic one. the layer 1 device activates the quicc by enabling the clock pulses and by an indication in the channel 0 c/i channel. the quicc will report to the cpu32+ core by a maskable interrupt that a valid indication is in the smc receive bd. when the cpu32+ core activates the line, the data output of l1txdn is programmed to zero by setting the stzx bit in the simode register. code 0 (command timing tim) will be trans- mitted on channel 0 c/i channel to the layer 1 device until the stzx bit is reset. the physical layer device will resume the clock pulses and will give an indication in the channel 0 c/i channel. the cpu32+ core should reset the stzx bit to enable data output. 7.8.7.2 si gci programming. the following paragraphs describe programming for both the normal mode gci and scit. 7.8.7.2.1 normal mode gci programming. the user can program the channels used for the gci bus interface to the appropriate configuration. first, the user should program the simode to the gci/scit mode for that channel, using the dscx, fex, cex, and rfsdx bits. this mode defines the sync pulse to gci sync for framing and data clock as one-half the input clock rate. the user can program more than one channel to interface to the gci bus. also, if the receive and transmit section are used for interfacing the same gci bus, the user can internally connect the receive clock and sync signals to the si ram transmit sec- tion, using the crtx bits. the user should then define the gci frame routing and strobe select using the si ram. when the receive and transmit section use the same clock and sync signals, the user should program the receive section as well as the transmit section to the same configuration. the l1txdx pin in the i/o register should be programmed to be an open-drain output. to support the monitor and the c/i channels in gci, the user should route those channels to one of the smcs. to support the d channel when there is no possibility of collision, the user should clear the grx bit corresponding to the scc that supports the d channel in the simode. 7.8.7.2.2 scit programming. for interfacing the gci/scit bus, the user should program the simode to the gci/scit mode. the si ram is programmed to support a 96-bit frame length, and the frame sync is programmed to the gci sync pulse. generally, the scit bus supports the d channel access collision mechanism. for this purpose, the user should pro- gram the receive and transmit sections to use the same clock and sync signals, using the
serial interface with time slot assigner motorola mc68360 user? manual 7-99 crtx bits, and program the grx bits to transfer the d channel grant to the scc that sup- ports this channel. the user should mark the received bit, which is the grant bit, by program- ming the channel select bits of the si ram to 111 for an internal assertion of a strobe on this bit. this bit will be sampled by the si and transferred to the d channel scc as the grant. the bit is generally bit 4 of the c/i in channel 2 of gci, but any other bit may be selected using the si ram. for example, assuming scc1 is connected to the d channel, scc2 is connected to the b1 channel, and scc4 is connected to the b2 channel, smc1 is used to handle the c/i chan- nels, and the d channel grant is on bit 4 of the c/i on scit channel 2, the initialization se- quence is as follows: 1. program the si ram. write all entries that are not used with $0001, setting the lst bit and disabling the routing function. note since gci requires the same routing for both receive and trans- mit, an exact duplicate of the above entries should be written to both the receive and transmit sections of the si ram beginning at addresses 0 and 128, respectively. 2. simode = $000080e0. only tdma is used; smc1 is connected. scit mode is used in this example. note if scit mode is not used, delete the last three entries of the si ram and set the lst bit in the new last entry. 3. sicr = $400040c0. scc4, scc2, and scc1 are connected to the tsa. scc1 supports the grant mechanism since it is on the d channel. 4. paodr bit 6 = 1. configures l1txda to an open-drain output. 5. papar bits 6, 7, and 8 = 1. configures l1txda, l1rxda, and l1rclka. 6. padir bits 6 and 7 = 1. padir bit 8 = 0. configures l1txda, l1rxda, and l1rclka. entry ram word no. swtr ssel csel cnt byt lst description 1 0 0000 010 0000 1 0 8 bits scc2 2 0 0000 100 0000 1 0 8 bits scc4 3 0 0000 101 0000 1 0 8 bits smc1 4 0 0000 001 0001 0 0 2 bits scc1 5 0 0000 101 0101 0 0 6 bits smc1 6 0 0000 000 0110 1 0 skip 7 bytes 7 0 0000 000 0001 0 0 skip 2 bits 8 0 0000 111 0000 0 1 d grant bit
serial interface with time slot assigner 7-100 mc68360 user? manual motorola 7. if the 1 gci data clock is required, set pbpar bit 11 and pbdir bit 11, which configures l1clkoa as an output. 8. pcpar bit 11 = 1. configures l1rsynca. 9. sigmr = $04. enable tdma (one static tdm). 10. 1sicmr is not used. 11. 1sistr and sirp do not need to be read, but can be used for debugging information once the channels are enabled. 12. 1enable the scc1 for hdlc operation (to handle the lapd protocol of the d channel), set scc2 and scc4 as desired, and enable smc1 for scit operation. 7.8.8 serial interface synchronization on rev a and b of the quicc, the si would reset itself if an unexpected sync pulse was seen during the middle of a time frame. this would cause the si to sync again on the following sync pulse but it would also lead to an unresolved loss of synchronization of an scc or smc operating in transparent or gci modes (assuming that scc or smc was receiving data from the si). in revision c.1 and later of the quicc, the si will ignore this unexpected sync pulse and synchronize on the next sync pulse (it will not reset itself). this may lead to a reception of one or two ?ad?slots but the scc or smc will remain synchronized. note rev a mask is c63t rev b mask are c69t, and f35g current rev c mask are e63c, e68c and f15w 7.8.9 nmsi configuration the si supports an nmsi mode for each of the sccs and smcs. the decision of whether to connect a given scc to the nmsi is made in the sicr. the decision of whether to con- nect a given smc to the nmsi is made in the simode register. an scc or smc may be connected to the nmsi, regardless of which other channels are connected to a tdm channel. the user should note, however, that nmsi pins may be mul- tiplexed with other functions at the parallel i/o lines. therefore, if a combination of tdm and nmsi channels is used, the decision of which sccs and smcs to connect and where to con- nect them should be made consulting the quicc pinout. generally speaking, the tdma channel is multiplexed with many of the scc4 pins; whereas, the tdmb channel is multi- plexed with many of the scc3 pins. the clocks that are provided to the sccs and smcs are derived from twelve sources: four internal baud rate generators and eight external clk pins (see figure 7-35). there are two main advantages to the bank-of-clocks approach. first, an scc or smc is not forced to
serial interface with time slot assigner motorola mc68360 user? manual 7-101 choose its clock from a pre-defined pin or baud rate generator, which allows flexibility in the pinout mapping strategy. second, if a group of scc receivers and transmitters need the same clock rate, they can share the same pin. this configuration leaves additional pins for other functions and minimizes potential skew between multiple clock sources. the four baud rate generators also make their clocks available to external logic, regardless of whether the baud rate generators are being used by an scc or smc. note that the brgox pins are multiplexed with other functions; therefore, all brgox pins may not always be available. note that brgo3 has the flexibility to be output on both port a 12 and port b 16. see the pinout description in section 11 ordering information and mechanical data for more details. there are a few restrictions in the bank-of-clocks mapping. first, only eight of the twelve sources can be connected to any given scc receiver or transmitter. second the smc trans- mitter must have the same clock source as the receiver when connected to the nmsi pins. once the clock source is selected, the clock is given an internal name. for the sccs, the name is rclkx and tclkx. for the smcs, the name is simply smclkx. these internal names are used only in nmsi mode to specify the clock that is sent to the scc or smc. these names do not correspond to any pins on the quicc. note the internal rclkx and tclkx may be used as inputs to the dpll unit, which is inside the scc. thus, the rclkx and tclkx signals are not required to always reflect the actual bit rate on the line. the exact pins available to each scc and smc in the nmsi mode are summarized in figure 7-35. the scc1 in nmsi mode has its own set of modem control pins: txd1 rxd1 tclk1 <- brg1?rg4, clk1?lk4 rclk1 <- brg1?rg4, clk1?lk4 rts1 cts1 cd1 the scc2 in nmsi mode has its own set of modem control pins: txd2 rxd2 tclk2 <- brg1?rg4, clk1?lk4 rclk2 <- brg1?rg4, clk1?lk4 rts2
serial interface with time slot assigner 7-102 mc68360 user? manual motorola cts2 cd2 figure 7-35. bank of clocks the scc3 in nmsi mode has its own set of modem control pins: txd3 rxd3 tclk3 <- brg1?rg4, clk5?lk8 rclk3 <- brg1?rg4, clk5?lk8 rts3 cts3 cd3 smc1 smc2 scc3 rx scc3 tx scc4 rx scc4 tx scc1 rx scc1 tx scc2 rx scc2 tx brg1 brg2 brg3 brg4 clk1 clk2 clk3 clk4 clk5 clk6 clk7 clk8 smclk1 rclk1 tclk1 smclk2 rclk2 rclk3 rclk4 tclk2 tclk3 tclk4 brgo1 brgo2 brgo3 brgo4 bank of clocks selection logic sccs controlled in the sicr. smcs controlled in simode.
baud rate generators (brgs) motorola mc68360 user? manual 7-103 the scc4 in nmsi mode has its own set of modem control pins: txd4 rxd4 tclk4 <- brg1?rg4, clk5?lk8 rclk4 <- brg1?rg4, clk5?lk8 rts4 cts4 cd4 the smc1 in nmsi mode has its own set of modem control pins: smtxd1 smrxd1 smclk1 <- brg1?rg4, clk1?lk4 smsyn1 (used only in the totally transparent protocol) the smc2 in nmsi mode has its own set of modem control pins: smtxd2 smrxd2 smclk2 <- brg1?rg4, clk5?lk8 smsyn2 (used only in the totally transparent protocol) any scc or smc that requires fewer pins that those listed may use that pin for another func- tion or configure that pin as a parallel i/o pin. since some sccs use external clock pins clk1?lk4 and other sccs use external clock pins clk5?lk8, it might seem that there is no way to provide one external clock source on one clk pin to be used by all four sccs. however, the quicc provides a simple clock bridge function from external clk8 to the internal clk4 connection, even if the clk4 pin is used for another of its programmable functions. this configuration allows scc1/scc2 to share clocks with scc3/scc4 without wasting an external pin. this is shown in the port a registers in 7.14.4 port a registers. 7.9 baud rate generators (brgs) the cpm contains four, independent, identical brgs that can be used with the sccs and smcs. the clocks produced in the brg are sent to the bank-of-clocks selection logic, where they can be routed to the sccs and/or smcs. the bank-of-clocks logic is described in 7.8.9 nmsi configuration. in addition, the output of the brg may be routed to a pin to be used externally. the main features of the brgs are as follows: four, independent, identical brgs on-the-fly changes allowed each brg may be routed to one or more sccs or smcs a 16 divider option allows slow baud rates at high system frequencies each brg contains an autobaud support option
baud rate generators (brgs) 7-104 mc68360 user? manual motorola each brg output may be routed to a pin (e.g., brgo1) refer to figure 7-36 for the brg block diagram. figure 7-36. baud rate generator block diagram the clock input to the prescaler may be selected by the extc bits to come from one of three sources: brgclk, clk2, or clk6. each source is discussed in the following paragraphs. the brgclk is generated in the quicc clock synthesizer specifically for the four brgs (as well as a fifth brg that is part of the spi) and defaults to the system frequency (e.g., 25 mhz). however, the clock synthesizer in the sim60 has an option to divide the brgclk by 1, 4, 16, or 64 before it leaves the clock synthesizer. whatever the resulting frequency of brgclk, the user may use that frequency as the input to the quicc brgs. the ability to reduce the frequency of brgclk before it leaves the clock synthesizer is use- ful in low-power applications. in a low-power mode, the brg clocking could be a significant factor in overall quicc power consumption. thus, if the brgs do not need to generate high frequencies or do not require a high resolution in the user application, a lower frequency brgclk may be input to the brgs. the user may wish to dynamically change the general system clock frequency in the clock synthesizer (slow go mode) while still having the brg run at the original frequency. the brgclk allows this option also. note the brg configuration register may be written at any time, re- gardless of the brgclk input frequency. alternatively, the user may choose the clk2 or clk6 pins to be the clock source. an exter- nal pin allows flexible baud rate frequency generation, regardless of the system frequency. additionally, the clk2 or clk6 pins allow a single external frequency to become the input cd11?d0 clk2 autobaud control atb extc div16 mux prescaler divide by 1 or 16 12-bit counter 1?096 clock brgclk clk6 rxd1 brgo1 to pin and/or bank of clocks
baud rate generators (brgs) motorola mc68360 user? manual 7-105 clock for multiple brgs. the clock signals on the clk2 and clk6 pins are not synchronized internally prior to being used by the brg. next, the brg provides a divide-by-16 option before the clock reaches the prescaler. this option is chosen by the div16 bit. the clock is then divided in the prescaler by up to 4096. this input clock divide ratio can be programmed on the fly. two on-the-fly brg changes should not occur within a time shorter than the period of at least two brg input clocks. the output of the prescaler is sent internally to the bank of clocks and may also be output externally on the brgox pins of either the port a or port b parallel i/o. one brgox pin (brgo4?rgo1) is an output from the corresponding brg. if the brg divides the clock by an even value, the transitions of the brgo pin will always occur on the falling edge of the input clock to the brg. if the brg is programmed to an odd value, the transitions will alternate between the falling and rising edges of the input clock. additionally, the output of the brg may be sent to the autobaud control block described in the following paragraphs. 7.9.1 autobaud support in the autobaud process, a uart deduces the baud rate of its received character stream by looking at the pattern received as well as the timing information of that pattern. the quicc brgs have a built-in autobaud control function that automatically measures the length of a start bit and modifies the baud rate accordingly. (this capability was only available on the mc68302 with a special microcode option.) if the atb bit in the brg is set, the autobaud control block starts to search for a low level on the corresponding rxdx input line (rxd4?xd1). when it finds a low level on the rxdx line, it assumes that this is the beginning of a start bit and begins counting the start bit length. during this time, the brg output clock toggles for 16 brg clock cycles at the brg input clock rate, and then stops with the brgo output clock in the low state. after the rxdx line changes back to the high level, the autobaud control block rewrites the cd and div16 bits in the brg configuration register to the divide ratio it found. due to mea- surement error that can occur at high baud rates, this divide rate written by the autobaud controller may not be the precise, final baud rate desired by the user (e.g., 56600 could be the resulting baud rate, rather than 57600). thus, an interrupt is provided to the user in the uart scc event register to signify that the brg configuration register was rewritten by the autobaud controller. on recognition of this interrupt, the user should rewrite the brg con- figuration register with the desired value. the user is encouraged to do this as quickly as possible, even prior to the first character being fully received, to ensure that all characters are recognized correctly by the uart. the first data must have a transition from 1 to 0, then look for a one again. thus the first cahracter must be an odd character. once a full character is received, the user may check in software to see if the received char- acter matches a predefined value (such as "a" or "a"; it must be an odd character). software should then check for other characters (such at "t" or "t") and program the scc to the
baud rate generators (brgs) 7-106 mc68360 user? manual motorola desired parity mode. changes in the parity mode may be accomplished in the uart proto- col specific mode register (psmr). notes the scc associated with this brg must be programmed to uart mode. the scc must have the tdcr and rdcr bits in the general scc mode register set to the 16 option for the au- tobaud function to operate correctly. the input clock that is supplied to the brg in autobaud mode should be as fast as possible to improve the accuracy of the start bit measurement. input frequencies such as 1.8432mhz, 3.68mhz, 7.36mhz and 14.72mhz should be used. for autobaud to operate sucessfully, the scc performing the autobaud function must be connected to the baud rate generator for that scc. in other words, for scc2 to correctly perform the autobaud function, it must be clocked by brg2. also, for the scc to correctly detect an autobaud lock and an interrupt to be generated, the scc must receive three full rx clocks from the brg before the autobaud process begins. to do this, first set the gsmr with the atb=0 and enable the brg rx clock to the highest frequency. immediately prior to the start of the autobaud process (after device initialization) set the atb bit equal to a one. 7.9.2 brg configuration register (brgc) each brgc is a 24-bit, memory-mapped, read/write register that is cleared at reset. a reset disables the brg and puts the brgo output clock to the high level. the brgc can be writ- ten at any time with no need to disable the sccs or the external devices that are connected to the brgo output clock. the brg changes will occur at the end of the next brg clock cycle (no spikes will occur on the brgo output clock). the brgc allows on-the-fly changes. two on-the-fly changes to the brg should not occur within a time shorter than the period of at least two brg input clocks. bits 23?8?eserved 23 22 21 20 19 18 17 16 15 14 13 12 rst en extc1?xtc0 atb cd11 11109876543210 cd10 cd9 cd8 cd7 cd6 cd5 cd4 cd3 cd2 cd1 cd0 div16
baud rate generators (brgs) motorola mc68360 user? manual 7-107 rst?eset brg this bit performs a software reset of the brg identical to that of an external reset. a reset disables the brg and sets the brgo output clock. (this can only be seen externally if the brgo function is enabled to reach the corresponding port b parallel i/o pin.) 0 = enable the brg. 1 = reset the brg (software reset). en?nable brg count this bit is used to dynamically stop the brg from counting, which may be useful for low- power modes. 0 = stop all clocks to the brg. 1 = enable clocks to the brg. extc1?xtc0?xternal clock source the extc bits select the brg input clock from the internal brgclk or one of three ex- ternal pins. 00 = the brg input clock comes from the brgclk (internal clock generated by the clock synthesizer in the sim60). 01 = the brg input clock comes from the clk2 pin. 10 = the brg input clock comes from the clk6 pin. 11 = reserved. atb?utobaud when set, this bit selects autobaud operation of the brg on the corresponding rxdx pin. 0 = normal operation of the brg. 1 = when rxdx goes low, the brg will determine the length of the start bit and syn- chronize the brg to the actual baud rate. note this bit must remain clear (0) until the scc receives 3 rx clocks, then the user must set this bit to one in order to obtain the correct baud rate. when the baud rate is obtained and locked it will be indicated by setting the ab bit in the uart event register. cd11?d0?lock divider the clock divider bits, cd11?d0, and the prescaler determine the brg output clock rate. cd11?d0 are used to preset a 12-bit counter that is decremented at the prescaler output rate. the counter is not accessible to the user. when the counter reaches zero, it is reloaded from the clock divider bits. thus, a value of $fff in cd11?d0 produces the minimum clock rate (divide by 4096), and a value of $0000 produces the maximum clock rate (divide by 1). even when dividing by an odd number, the counter ensures a 50% duty cycle by asserting the terminal count once on clock low and next on clock high. the terminal count signals counter expiration and toggles the clock.
baud rate generators (brgs) 7-108 mc68360 user? manual motorola div16?rg clock prescaler divide by 16 the brg clock prescaler bit selects a divide-by-1 or divide-by-16 prescaler for the clock divider input. 7.9.3 uart baud rate examples for synchronous communication using internal baud rate generator, the brgo output clock must never be faster than the syncclk frequency divided by 2. produced in the clock syn- thesizer in the sim60, syncclk is the frequency used internally by the synchronization cir- cuitry in the sccs, smcs, and spi. it defaults to the main system frequency (e.g., 25 mhz). thus, with a 25-mhz system where the syncclk is the same as the main system frequency, the maximum brgo output clock rate is 12.5 mhz. the user should program the uart to 16 oversampling (rdcr and tdcr bits in the gen- eral scc mode register) when using the scc as a uart. (on the quicc, 8 and 32 options are also available.) assuming 16 oversampling is chosen in the uart, a data rate of 25mhz 16 = 1.5625 mbits/sec is the maximum possible uart speed. putting this together, the following formula for calculating the bit rate based on a particular brg configuration for a uart: async baud rate = (brgclk or clk2 or clk6) (clock divider + 1) (1 or 16 depending on the div16 bit) (8 or 16 or 32 according to the rdcr and tdcr bits in the general scc mode register). table 7-3 lists examples of typical bit rates of asynchronous communication. note that for this mode, the internal clock rate is assumed to be 16 the baud rate. note: all values are decimal. table 7-4. typical baud rates of asynchronous communication quicc system frequency (mhz) 20 25 24.5760 baud rates div16 div actual frequency div16 div actual frequency div16 div actual frequency 50 1 1561 50.02 1 1952 50 1 1919 50 75 1 1040 75.05 1 1301 75 1 1279 75 150 1 520 149.954 1 650 150 1 639 150 300 1 259 300.48 1 324 300.5 1 319 300 600 0 2082 600.09 0 2603 600 0 2559 600 1200 0 1040 1200.7 0 1301 1200 0 1279 1200 2400 0 520 2399.2 0 650 2400.1 0 639 2400 4800 0 259 4807.7 0 324 4807.69 0 319 4800 9600 0 129 9615.4 0 162 9585.9 0 159 9600 19200 0 64 19231 0 80 19290 0 79 19200 38400 0 32 37879 0 40 38109 0 39 38400 57600 0 21 56818 0 26 57870 0 26 56889 115200 0 10 113636 0 13 111607 0 12 118154
serial communication controllers (sccs) motorola mc68360 user? manual 7-109 for synchronous communication, the internal clock is identical to the baud rate output. to get the desired rate, the user can select the appropriate system clock according to the fol- lowing equation: sync baud rate = (brgclk or clk2 or clk6) (clock divider + 1) (1 or 16 according to the div16 bit) for example, to get the rate of 64 kbps, the system clock can be 24.96 mhz, div16 = 0, and the clock divider = 389. 7.10 serial communication controllers (sccs) the scc key features are as follows: implements hdlc/sdlc, hdlc bus, bisync, synchronous start/stop, asynchro- nous start/stop (uart), appletalk (localtalk), and totally transparent protocols ethernet version of quicc supports full 10 mbps ethernet/ieee 802.3 on scc1 additional protocols supported through motorola-supplied ram microcodes: profi- bus, signaling system#7 (ss7), async hdlc, ddcmp, v.14, and x.21 (see appendix c risc microcode from ram ) . 2 mbps hdlc, hdlc bus, and/or transparent data rates supported on all four sccs simultaneously (full duplex). 10 mbps ethernet (half duplex) on scc1 and 2 mbps on the other sccs supported simultaneously (full duplex) a single hdlc or transparent channel can be supported at 8 mbps (full duplex) scc clocking rates up to 12.5 mhz at 25 mhz. dpll circuitry for clock recovery with nrz, nrzi, fm0, fm1, manchester, and differ- ential manchester (also known as differential biphase-l) scc clocks may be derived from a baud rate generator, an external pin, or dpll. data clock may be as high as 3.125 mhz with a 25-mhz clock supports automatic control of the rts , cts , and cd modem signals multibuffer data structure for receive and transmit (up to 224 bds may be partitioned in any way desired) deep fifos (scc1 has 32-byte rx and tx fifos; scc2, scc3, and scc4 have 16- byte rx and tx fifos) transmit-on-demand feature decreases time to frame transmission low fifo latency option for transmit and receive in character-oriented and totally transparent protocols frame preamble options full-duplex operation fully transparent option for receiver/transmitter while another protocol executes on the transmitter/receiver echo and local loopback modes for testing
serial communication controllers (sccs) 7-110 mc68360 user? manual motorola note the performance figures listed in the key features assume a 25- mhz system clock. 7.10.1 scc overview the quicc has four sccs that can be configured independently to implement different pro- tocols. together, they can be used to implement bridging functions, routers, gateways, and interface with a wide variety of standard wide area networks, local area networks, and pro- prietary networks. the sccs have many physical interface options such as interfacing to tdm buses, isdn buses, and standard modem interfaces (see 7.8 serial interface with time slot assigner). on the quicc, the scc does not include the physical interface, but it is the logic which for- mats and manipulates the data obtained from the physical interface. that is why the si sec- tion is described separately. the choice of protocol is independent of the choice of physical interface. the scc is described in terms of the protocol that it is chosen to run. when an scc is pro- grammed to a certain protocol, it implements a certain level of functionality associated with that protocol. for most protocols, this corresponds to portions of the link layer (layer 2 of the seven-layer iso model). many functions of the scc are common to all of the protocols. these functions are described first in the scc description. following that, the specific imple- mentation details that make one protocol different from the others are discussed, beginning with the uart protocol. thus, the reader should read from this point up to the uart proto- col, and then skip to the particular protocol desired. since the sccs use similar data struc- tures across all protocols, the reader's learning time will decrease dramatically after understanding the first protocol. each scc supports a number of protocols: hdlc/sdlc, hdlc bus, bisync, asynchro- nous or synchronous start/stop (uart), totally transparent operation, and appletalk (i.e., localtalk). in addition, ethernet is available on scc1 of the ethernet version of the quicc. although the protocol that is chosen usually applies to both the scc transmitter and receiver, the sccs have an option of running one-half of the scc with transparent operation while the other half runs the standard protocol. each of the internal clocks (rclk, tclk) for each scc can be programmed with either an external or internal source. the internal clocks can originate from one of four baud rate gen- erators or one of four external clock pins. these clocks may be as fast as a 1:2 ratio of the system clock (i.e., 12.5 mhz); however, the scc? ability to support a sustained bit stream depends on the protocol as well as other factors. see appendix a serial performance for more details. associated with each scc is a digital phase-locked loop (dpll) for external clock recovery. the clock recovery options include nrz, nrzi, fm0, fm1, manchester, and differential manchester. the dpll may be configured to nrz operation in order to pass the clocks and data to/from the sccs without modifying them.
serial communication controllers (sccs) motorola mc68360 user? manual 7-111 each scc may be connected to its own set of pins on the quicc. this configuration is called the nmsi and is described in 7.8 serial interface with time slot assigner. in this con- figuration, each scc can support the standard modem interface signals (rts , cts , and cd ) through the port c pins and the cpm interrupt controller (cpic). additional handshake signals may be supported with additional parallel i/o lines. refer to the scc block diagram in figure 7-37. figure 7-37. scc block diagram 7.10.2 general scc mode register (gsmr) each scc contains a gsmr that defines all the options that are common to each scc, regardless of the protocol. detailed descriptions of some of the operations of the gsmr are given in later sections. gsmr is a read-write register that is cleared at reset. since gsmr is 64 bits in length, it is accessed as gsmr_l and gsmr_h. gsmr_l contains the first (low-order) 32 bits of gsmr; gsmr_h contains the last 32 bits of gsmr. 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 gde 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 tcrc revd trx ttx cdp ctsp cds ctss tfl rfw txsy synl rtsm rsyn 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 edge tci tsnc rinv tinv tpl tpp tend tdcr 1514131211109876543210 rdcr renc tenc diag enr ent mode imb control registers dpll and clock recovery tclkx rclkx clock generator peripheral bus modem lines receiver control unit receive data fifo transmitter control unit transmit data fifo decoder delimiter shifter delimiter shifter encoder txd modem lines internal clocks rxd
serial communication controllers (sccs) 7-112 mc68360 user? manual motorola bits 63?9, 31?eserved gde?litch detect enable this bit determines whether the scc will look for glitches on the external receive and transmit serial clock lines provided to this scc. if this feature is enabled, the presence of a glitch will be reported in the scc event register. whether or not gde is set, the scc always attempts to clean up the clocks that it uses internally via a schmitt trigger on the input lines. 0 = no glitch detection is performed. this option should be chosen if the external serial clock exceeds the limits of the glitch detection logic (6.25 mhz assuming a 25-mhz system clock). this option should also be chosen if the scc clock is provided from one of the internal baud rate generators. lastly, this option should be chosen if ex- ternal clocks are used and it is more important to minimize power consumption than to watch for glitches. 1 = glitch detection is performed with a maskable interrupt generated in the scc event register. tcrc?ransparent crc (valid for a totally transparent channel only) these bits select the type of frame checking that is provided on the transparent channels of this scc (either the receiver, transmitter, or both as defined by ttx and trx). al- though this configuration selects a frame check type, the actual decision to send the frame check is made in the tx bd. thus, it is not required to send a frame check in transparent mode. if a frame check is not used, the user may simply ignore the frame check errors that are generated on the receiver. 00 = 16-bit ccitt crc (hdlc). (x16 + x12 + x5 + 1) 01 = crc16 (bisync). (x16 + x15 + x2 + 1) 10 = 32-bit ccitt crc (ethernet and hdlc). (x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x1 +1) 11 = reserved revd?everse data (valid for a totally transparent channel only) 0 = normal operation. 1 = when set, this bit will cause the totally transparent channels on this scc (either the receiver, transmitter, or both as defined by ttx and trx) to reverse the bit or- der, transmitting the msb of each octet first. see 7.10.20.11 bisync mode reg- ister (psmr) for the method of reversing the bit order in the bisync protocol. trx?ransparent receiver the quicc sccs offer totally transparent operation. however, to increase flexibility, to- tally transparent operation is not configured with the mode bits, but with the ttx and trx bits. this gives the user the opportunity to implement unique applications, such as an scc transmitter configured to uart and the receiver configured to totally transparent operation. to do this, set mode = uart, ttx = 0, and trx = 1. 0 = normal operation. 1 = the receiver operates in totally transparent mode, regardless of the protocol se- lected for the transmitter in the mode bits.
serial communication controllers (sccs) motorola mc68360 user? manual 7-113 note full-duplex totally transparent operation for an scc is obtained by setting both ttx and trx. an scc cannot operate with ethernet on its transmitter simulta- neously with transparent operation on its receiver, or erratic be- havior will result. in other words, if the gsmr mode = ethernet, ttx must equal trx, or erratic operation will result. ttx?ransparent transmitter the quicc sccs offer totally transparent operation. however, to increase flexibility, to- tally transparent operation is not configured with the mode bits, but with the ttx and trx bits. this gives the user the opportunity to implement unique applications, such as an scc receiver configured to hdlc and the transmitter configured to totally transparent operation. to do this, set mode = hdlc, ttx = 1, and trx = 0. 0 = normal operation. 1 = the transmitter operates in totally transparent mode, regardless of the protocol se- lected for the receiver in the mode bits. note full-duplex totally transparent operation for an scc is obtained by setting both ttx and trx. an scc cannot operate with ethernet on its receiver simulta- neously with transparent operation on its transmitter, or erratic behavior will result. in other words, if the gsmr mode = ether- net, ttx must equal trx, or erratic operation will result. cdp?d pulse 0 = normal operation?nvelope mode. the cd pin should envelope the frame, and negating cd while receiving will cause a cd lost error. 1 = pulse mode. once the cd pin is asserted, synchronization has been achieved, and further transitions of cd will have no effect on reception. this mode is similar to the way the cd (sync) pin is used on the mc68302 in totally trans- parent mode. to mimic this behavior on the quicc, the external sync signal should be connected to the cd and cts pins on the quicc, and the cdp and ctsp bits should be set. note this bit must be set if this scc is used in tsa. ctsp?ts pulse 0 = normal operation?nvelope mode. the cts pin should envelope the frame, and a negation of cts while transmitting will cause a cts lost error. 1 = pulse mode. once the cts pin is asserted, synchronization has been achieved, and further transitions of cts will have no effect on transmission.
serial communication controllers (sccs) 7-114 mc68360 user? manual motorola cds?d sampling 0 = the cd input is assumed to be asynchronous with the data. it is internally synchro- nized by the scc, and then data is received. 1 = the cd input is assumed to be synchronous with the data, giving faster operation. in this mode, cd must transition while the receive clock is in the low state. as soon as cd is low, data begins being received. this mode is especially useful when con- necting quiccs in transparent mode since it allows the rts pin of one quicc to be directly connected to the cd pin of the other quicc. ctss?ts sampling 0 = the cts input is assumed to be asynchronous with the data. it is internally syn- chronized by the scc, and data is then transmitted after several serial clock de- lays. 1 = the cts input is assumed to be synchronous with the data, giving faster operation. in this mode, cts must transition while the transmit clock is in the low state. as soon as cts is low, data immediately begins transmission. this mode is especially useful when connecting quiccs in transparent mode since it allows the rts pin of one quicc to be directly connected to the cts pin of the other quicc. tfl?ransmit fifo length 0 = normal operation. the transmit fifo is 32 bytes for scc1 and 16 bytes for the oth- er sccs. 1 = the transmit fifo is 1 byte. this may be used with character-oriented protocols such as uart to ensure a minimum fifo latency at the expense of performance. rfw?x fifo width 0 = rx fifo is 32-bits wide for maximum performance. data will not normally be writ- ten to receive buffers until at least 32 bits have been received. this configuration is required for hdlc-type protocols and ethernet; it is the recommended configu- ration for high-performance transparent modes. in this mode, the receive fifo is 32 bytes for scc1 and 16 bytes for the other sccs. 1 = low-latency operation. the rx fifo is 8-bits wide, and the receive fifo is one- fourth its normal size (8 bytes for scc1 and 4 bytes for the other sccs). this al- lows data to be written to the data buffer each time a character is received, without waiting for 32 bits to be received. this configuration must be chosen for character- oriented protocols such as uart and bisync. it may also be used for low-perfor- mance, low-latency, totally transparent operation if desired. it must not be used with hdlc, hdlc bus, appletalk, or ethernet, or erratic behavior may result. txsy?ransmitter synchronized to the receiver the txsy bit is particularly intended for x.21 applications where the transmitted data must begin an exact multiple of 8-bit periods after the receive data arrives. 0 = no synchronization between receiver and transmitter (default). 1 = the transmit bit stream is synchronized to the receiver. additionally, if rsyn = 1, then transmission in the totally transparent mode will not occur until the receiver has synchronized with the bit stream and the cts signal is asserted to the scc. assuming cts is already asserted, transmission will begin eight clocks after the
serial communication controllers (sccs) motorola mc68360 user? manual 7-115 receiver begins receiving data. this behavior is similar to the mc68302 totally transparent mode behavior when the exsyn bit in its scc mode register is set. synl?ync length (bisync and transparent mode only) these bits determine the operation of an scc receiver that is configured for bisync or totally transparent operation only. see the data synchronization register definition in the bisync and totally transparent descriptions for more information. 00 = the sync pattern in the dsr is not used. an external sync signal is used instead (cd pin asserted). 01 = 4-bit sync. the receiver will synchronize on a 4-bit sync pattern stored in dsr. this character and additional syncs can be programmed to be stripped using the sync character in the parameter ram. the transmitter will transmit the entire contents of the dsr prior to each frame. 10 = 8-bit sync. this option should be chosen along with the bisync protocol to im- plement mono-sync. the receiver will synchronize on an 8-bit sync pattern stored in dsr. the transmitter will transmit the entire contents of the dsr prior to each frame. 11 = 16-bit sync. also called bisync. the receiver will synchronize on a 16-bit sync pattern stored in dsr. the transmitter will transmit the dsr prior to each frame. rtsm?ts mode this bit may be changed on the fly. 0 = send idles between frames as defined by the protocol and the tend bit. rts is ne- gated between frames (default). 1 = send flags/syncs between frames according to the protocol. rts is always assert- ed whenever the scc is enabled. rsyn?eceive synchronization timing (valid for a totally transparent channel only) 0 = normal operation. 1 = if cds = 1, then the cd pin should be asserted on the second bit of the receive frame, rather than the first. this configuration matches the behavior of the mc68302 totally transparent receiver when its exsyn bit is set; it is included on the quicc for compatibility. edge?lock edge the edge bits determine the clock edge used by the dpll for adjusting the receive sam- ple point due to jitter in the received signal. the selection of the edge bits is ignored in the uart protocol or the x1 mode of the rdcr bits. 00 = both the positive and negative edges are use for changing the sample point (de- fault). 01 = positive edge. only the positive edge of the received signal is used for changing the sample point. 10 = negative edge. only the negative edge of the received signal is used for changing the sample point. 11 = no adjustment is made to the sample points.
serial communication controllers (sccs) 7-116 mc68360 user? manual motorola tci?ransmit clock invert 0 = normal operation. 1 = the internal transmit clock (tclk) is inverted by the scc before it is used. this option allows the scc to clock data out one-half clock earlier, on the rising edge of tclk rather than the falling edge. in this mode, the scc offers a minimum and maximum "rising clock edge to data" specification. data output by the scc after the rising edge of an external transmit clock can be latched by the external receiver one clock cycle later on the next rising edge of the same transmit clock. this option is recommended for ethernet, hdlc, or transparent operation when the clock rates are high (e.g., above 8 mhz) to improve data setup time for the external re- ceiver. tsnc?ransmit sense this bit indicates the amount of time the internal sense signal will stay active after the last transition on the rxd pin, indicating that the line is free. for instance, these bits can be used in the appletalk protocol to avoid the spurious c s -changed interrupt that would oth- erwise occur during the frame sync sequence that precedes the opening flags. if rdcr is configured to 1 mode, the delay is the greater of the two numbers listed. if rdcr is configured to 8 , 16 , or 32 mode, the delay is the lesser of the two numbers listed. 00 = infinite?arrier sense is always active (default) 01 = 14 or 6.5 bit times as determined by the rdcr bits 10 = 4 or 1.5 bit times as determined by the rdcr bits (normally chosen for appletalk) 11 = 3 or 1 bit times as determined by the rdcr bits rinv?pll receive input invert data 0 = no invert 1 = invert the data before it is sent to the on-chip dpll for reception. this setting is used to produce fm1 from fm0, nrzi space from nrzi mark, etc. it may also be used in regular nrz mode to invert the data stream. note this bit must be 0 in hdlc bus mode. tinv?pll transmit input invert data 0 = no invert 1 = invert the data before it is sent to the on-chip dpll for transmission. this setting is used to produce fm1 from fm0, nrzi space from nrzi mark, etc. it may also be used in regular nrz mode to invert the data stream. note this bit must be 0 in hdlc bus mode. in t1 applications, setting tinv and tend creates a continu- ously inverted hdlc data stream.
serial communication controllers (sccs) motorola mc68360 user? manual 7-117 tpl?x preamble length the tpl bits determine the length of the preamble configured by the tpp bits. 000 = no preamble (default) 001 = 8 bits (1 byte) 010 = 16 bits (2 bytes) 011 = 32 bits (4 bytes) 100 = 48 bits (6 bytes) (select this setting for ethernet operation.) 101 = 64 bits (8 bytes) 110 = 128 bits (16 bytes) 111 = reserved tpp?x preamble pattern the tpp bits determine what, if any, bit pattern should precede the start of each transmit frame. the preamble pattern will be sent prior to the first flag/sync of the frame. tpp is ignored if the scc is programmed to uart mode. the length of the preamble is pro- grammed in tpl. the preamble pattern is typically transmitted to a receiving station that uses a dpll for clock recovery. the receiving dpll uses the regular pattern of the pre- amble to help it lock onto the received signal in a short, predictable time period. 00 = all zeros 01 = repeating 10? (select this setting for ethernet operation.) 10 = repeating 01? 11 = all ones (select this setting for localtalk operation.) tend?ransmitter frame ending this bit is intended particularly for the nmsi transmitter encoding of the dpll. tend de- termines whether the txd line should idle in a high state or in an encoded ones state (which may be either high or low). it may, however, be used with other encodings besides nmsi. 0 = default operation. the txd line is encoded only when data is transmitted (includ- ing the preamble and opening and closing flags/syncs). when no data is available to transmit, the line is driven high. 1 = the txd line is always encoded (even when idles are transmitted). tdcr?ransmit divide clock rate the tdcr bits determine the divider rate of the transmitter. if the dpll is not used, the 1 value should be chosen, except in asynchronous uart mode where 8 , 16 , or 32 must be chosen. the user should program tdcr to equal rdcr in most applications. if the dpll is used in the application, the selection of tdcr depends on the encoding. nrzi usualy requires 1 ; whereas, fm0/fm1, manchester, and differential manchester allow 8 , 16 , or 32 . the 8 option allows highest speed; whereas, the 32 option pro- vides the greatest resolution. tdcr is usually equal to rdcr to allow the same clock fre- quency source to control both the transmitter and receiver. 00 = 1 clock mode (only nrz or nrzi encodings are allowed.) 01 = 8 clock mode 10 = 16 clock mode (normally chosen for uart and appletalk) 11 = 32 ? clock mode
serial communication controllers (sccs) 7-118 mc68360 user? manual motorola rdcr?eceive dpll clock rate the rdcr bits determine the divider rate of the receive dpll. if the dpll is not used, the 1 value should be chosen, except in asynchronous uart mode where 8 , 16 , or 32 must be chosen. the user should program rdcr to equal tdcr in most applica- tions. if the dpll is used in the application, the selection of rdcr depends on the encoding. nrzi usualy requires 1 ; whereas, fm0/fm1, manchester, and differential manchester allow 8 , 16 , or 32 . the 8 option allows highest speed; whereas, the 32 option pro- vides the greatest resolution. 00 = 1 clock mode (only nrz or nrzi decodings are allowed.) 01 = 8 clock mode 10 = 16 clock mode (normally chosen for uart and appletalk) 11 = 32 clock mode renc?eceiver decoding method select nrz if the dpll is not used. the user should program renc to equal tenc in most applications. do not use this internal dpll for ethernet mode. 000 = nrz (default setting if dpll is not used) 001 = nrzi mark (set rinv also for nrzi space) 010 = fm0 (set rinv also for fm1) 011 = reserved 100 = manchester 101 = reserved 110 = differential manchester (differential biphase-l) 111 = reserved tenc?ransmitter encoding method select nrz if the dpll is not used. the user should program tenc to equal renc in most applications. do not use this internal dpll for ethernet mode. 000 = nrz (default setting if dpll is not used) 001 = nrzi mark (set tinv also for nrzi space) 010 = fm0 (set tinv also for fm1) 011 = reserved 100 = manchester 101 = reserved 110 = differential manchester (differential biphase-l) 111 = reserved diag?iagnostic mode in normal operation mode, the scc operates normally. the receive data enters the rxd pin and the transmit data is shifted out through the txd pin. the scc uses the modem signals (cd and cts ) to automatically enable and disable transmission and reception. these timings are shown in 7.10.11 scc timing control. 00 =normal operation (cts and cd signals under automatic control) in local loopback mode, the transmitter output is internally connected to the receiver input, while the receiver and the transmitter operate normally. the value on the rxd pin is ig-
serial communication controllers (sccs) motorola mc68360 user? manual 7-119 nored. data can be programmed to appear on the txd pin, or the txd pin can remain high by programming the port a register. the rts line can also be programmed to be dis- abled in the appropriate parallel i/o register. in tdm modes, the l1txdx and l1rqx lines can be programmed to be either asserted normally or to remain inactive by programming the serial interface mode register (simode). when using local loopback mode, the clock source for the transmitter and the receiver must be the same. thus, the same baud rate generator may be used for both transmitter and receiver, or the same external clkx pin may be used for both transmitter or receiver. (separate clkx pins may be used with the transmitter and receiver as long as the clkx pins are connected to the same external clock signal source.) 01 =local loopback mode note if external loopback is desired, the diag bits should be selected for normal operation, and an external connection should be made between the txd and rxd pins. clocks may be generat- ed internally by a baud rate generator or generated externally. the user may physically connect the appropriate control signals (rts connected to cd , and cts grounded) or the port c regis- ter may be used to cause the cd and cts pins to be permanent- ly asserted to the scc. in automatic echo mode, the channel automatically retransmits the received data on a bit- by-bit basis using whatever receive clock is provided. the receiver operates normally and can receive data if cd is asserted. the transmitter simply transmits received data. in this mode, the cts line is ignored. the echo function may also be accomplished in software by receiving buffers from an scc, linking them to tx bds and then transmitting them back out of that scc. 10 = automatic echo mode in loopback/echo mode, loopback operation and echo operation occur simultaneously. the cd pin and cts pins are ignored. see the loopback bit description for clocking re- quirements. 11 = loopback and echo mode note users familiar with the mc68302 may notice that the quicc does not contain "software operation" mode. the software oper- ation mode as implemented on the mc68302 can be implement- ed on the quicc using parallel i/o port c. enr?nable receive this bit enables the receiver hardware state machine for this scc. when enr is cleared, the receiver is disabled, and any data in the receive fifo is lost. if enr is cleared during reception, the receiver aborts the current character. enr may be set or cleared regard-
serial communication controllers (sccs) 7-120 mc68360 user? manual motorola less of whether serial clocks are present. see 7.10.14 disabling the sccs on the fly for a description of the proper methods to disable and reenable an scc. note the scc provides other tools to control reception besides the enr bit. they are the enter hunt mode command, the close rx bd command, and the e-bit in the rx bd. ent?nable transmit this bit enables the transmitter hardware state machine for this scc. when ent is cleared, the transmitter is disabled. if ent is cleared during transmission, the transmitter aborts the current character, and the txd pin returns to the idle state. data already in the transmit shift register will not be transmitted. ent may be set or cleared regardless of whether serial clocks are present. see 7.10.14 disabling the sccs on the fly for a de- scription of the proper methods to disable and reenable an scc. note the scc provides other tools to control transmission besides the ent bit. they are the stop transmit command, the graceful stop transmit command, the restart transmit command, the freeze option in uart mode, the cts flow control option in uart mode, and the ready (r) bit in the tx bd. mode?hannel protocol mode 0000 = hdlc 0001 = reserved 0010 = appletalk (localtalk) 0011 = ss7 (reserved for ram microcode) 0100 = uart 0101 = profibus (reserved for ram microcode) 0110 = async hdlc (reserved for ram microcode) 0111 = v.14 (reserved for ram microcode) 1000 = bisync 1001 = ddcmp (reserved for ram microcode) 1010 = reserved 1011 = reserved 1100 = ethernet 11xx = reserved 7.10.3 scc protocol-specific mode register (psmr) the functionality of the scc varies according to the protocol selected by the mode bits in the gsmr. each of the four scc has an additional 16-bit, memory-mapped, read-write psmr that configures the scc to the special configurations within a chosen mode. a detailed description of the psmr bits is contained within each specific protocol. the psmrs are cleared at reset.
serial communication controllers (sccs) motorola mc68360 user? manual 7-121 7.10.4 scc data synchronization register (dsr) each of the four scc has a 16-bit, memory-mapped, read-write dsr. the dsr specifies the pattern used in the frame synchronization procedure in the synchronous protocols. in the uart protocol, it is used to configure fractional stop bit transmission. in the bisync and totally transparent protocol, it should be programmed with the desired sync pattern. in the ethernet protocol, it should be programmed with $d555. at reset, it defaults to $7e7e (two hdlc flags), so it does not need to be written for hdlc mode. when dsr is used to send out syncs (such as in bisync or transparent mode), the contents of the dsr are always transmitted lsb first. 7.10.5 scc transmit on demand register (todr) if no frame is currently being transmitted by an scc, the risc controller periodically polls the r-bit of the next tx bd to see if the user has requested a new frame/buffer to be trans- mitted. this polling algorithm depends on the scc configuration, but occurs every 8 to 32 serial transmit clocks. the user, however, has an option to request that the risc begin the processing of the new frame/buffer immediately, without waiting until the normal polling time. to obtain immediate processing, the tod bit in the transmit-on-demand register is set by the user once the user has set the r-bit in the tx bd. this feature, which decreases the transmission latency of the transmit buffer/frame, is par- ticularly useful in lan-type protocols where maximum interframe gap times are limited by the protocol specification. since the transmit-on-demand feature gives a high priority to the specified tx bd, it can conceivably affect the servicing of the other scc fifos. therefore, it is recommended that the transmit-on-demand feature only be used when a high-priority tx bd has been prepared and transmission on this scc has not occurred for a period of time. the tod bit does not need to be set if a new tx bd is added to the circular queue but other tx bds in that queue have not fully completed transmission. in that case, the new tx bd will be processed immediately following the completion of the older tx bd s. the first bit of the frame will typically be clocked out 5-6 bit times after tod has been written to a 1. tod?ransmit on demand 0 = normal operation 1 = the risc will give a high priority to the current tx bd and will not wait for the nor- mal polling time to check that the tx bd? r-bit has been set. it will begin transmit- ting the frame. this bit will be cleared automaticaly after one serial clock. 1514131211109876543210 syn2 syn1 1514131211109876543210 tod
serial communication controllers (sccs) 7-122 mc68360 user? manual motorola bits 14??eserved these bits should be written with zeros. 7.10.6 scc buffer descriptors data associated with each scc channel is stored in buffers. each buffer is referenced by a bd, which may be located anywhere in internal memory. the quicc internal memory has space for 224 bds to be shared between the four sccs and any smcs and spis that are used. however, the allocation of bds to the transmitter or receiver of a serial channel is user-defined. thus, the user may select 100 bds for the scc1 receiver, 20 bds for the scc1 transmitter, etc. the bd table forms a circular queue with a programmable length. the user can program the start address of each channel bd table in the internal memory (see figure 7-38). the user is allowed to allocate the parameter area of an unused channel to the other used channels as bd tables or as actual buffers. the format of the bds is the same for each scc mode of operation and for both transmit and receive. the first word in each bd contains a status and control word, which also deter- mines the bd table length. only this first field (containing the status and control bits) differs for each protocol. the second word determines the data length referenced to this bd, and the two last words in the bd contain the 32-bit address pointer that points to the actual buffer in memory. for frame-oriented protocols, a message may reside in as many buffers as necessary (transmit or receive). each buffer has a maximum length of (64k?)bytes. the cp does not assume that all buffers of a single frame are currently linked to the bd table; it does assume, however, that the unlinked buffers will be provided by the cpu32+ core in time to be either transmitted or received. failure to do so will result in an error condition being reported by the cp. an underrun error is reported in the case of transmit, and a busy error is reported in the case of receive. 150 offset + 0 status and control offset + 2 data length offset + 4 high-order data buffer pointer offset + 6 low-order data buffer pointer
serial communication controllers (sccs) motorola mc68360 user? manual 7-123 figure 7-38. scc memory structure all protocols can have their buffer descriptors point to data buffers that are located in internal dual-port ram. typically, however, due to the internal ram being used for buffer descrip- tors, it is customary for the data buffers to be located in external ram, especially if the data buffers are large in size. in all cases, the imb is used to transfer the data to the data buffer. the cp processes the tx bds in a straightforward fashion. once the transmit side of an scc is enabled, it starts with the first bd in that scc? transmit table. once the cp detects that the tx bd r-bit was set, it will begin processing the buffer. (the cp will detect that the bd is ready either by polling the r-bit periodically or by the user writing to the transmit-on- demand register (todr).) once the data from the bd has been placed in the transmit fifo, the cp moves on to the next bd, again waiting for that bd? r-bit to be set. thus, the cp does no look-ahead bd processing, nor does it skip over bds that are not ready. when the cp sees the wrap (w) bit set in a bd, it goes back to the beginning of the bd table after processing of the bd is complete. after using a bd, the cp normally sets the r-bit to not- dual-port ram scc1 tx bd table scc1 rx bd table scc1 rx bd table pointer scc1 tx bd table pointer rx buffer descriptors tx buffer descriptors frame status data length data pointer tx data buffer rx data buffer external memory frame status data length data pointer
serial communication controllers (sccs) 7-124 mc68360 user? manual motorola ready; thus, the cp will not use a bd twice until the bd has been confirmed by the cpu32+ core. (the one exception to this rule is that the quicc supports an option for repeated trans- mission, called the continuous mode, whereby the r-bit is left in the ready position. this is available in some protocols.) the cp uses the rx bds in a similar fashion. once the receive side of an scc is enabled, it starts with the first bd in that scc? rx bd table. once data arrives from the serial line into the scc, the cp performs certain required protocol processing on the data and moves the resultant data to the data buffer pointed to by the first bd. use of a bd is complete when there is no more room left in the buffer or when certain events occur, such as detection of an error or an end-of-frame. whatever the reason, the buffer is then said to be closed, and additional data will be stored using the next bd. whenever the cp needs to begin using a bd because new data is arriving, it will check the e-bit of that bd. if the current bd is not empty, it will report a busy error. however, it will not move from the current bd until it becomes empty. when the cp sees the w-bit set in a bd, it goes back to the beginning of the bd table after processing of the bd is complete. after using a bd, the cp sets the e-bit to not-empty; thus, the cp will never use a bd twice until the bd has been processed by the cpu32+ core. (the one exception to this rule is that the quicc supports an option for repeated reception, called the continuous mode, whereby the e-bit is left in the empty posi- tion. this is available in some protocols.) 7.10.7 scc parameter ram each scc parameter ram area begins at the same offset from each scc base area. the protocol-specific portions of the scc parameter ram are discussed in the specific protocol descriptions. the part of the scc parameter ram that is the same for all scc protocols is shown in table 7-5. certain parameter ram values (marked in boldface) need to be initialized by the user before the scc is enabled; other values are initialized/written by the cp. once initialized, most parameter ram values will not need to be accessed in user software since most of the activ- ity is centered around the transmit and rx bds, not the parameter ram. however, if the parameter ram is accessed by the user, the following regulations should be noted. the parameter ram can be read at any time. the parameter time values related to the scc transmitter can only be written whenever the transmitter is disabled (see 7.10.14 disabling the sccs on the fly), after a stop transmit and before a restart transmit com- mand, or after the buffer/frame completes transmission as a result of a graceful stop transmit command and before a restart transmit command. the parameter ram values related to the scc receiver can only be written when the receiver is disabled (see 7.10.14 disabling the sccs on the fly).
serial communication controllers (sccs) motorola mc68360 user? manual 7-125 note: the items in boldface should be initialized by the user. 7.10.7.1 bd table pointer (rbase, tbase). the rbase and tbase entries define the starting location in the dual-port ram for the set of bds for receive and transmit func- tions of the scc. this provides a great deal of flexibility in how bds for an scc are parti- tioned. by selecting rbase and tbase entries for all sccs, and by setting the w-bit in the last bd in each bd list, the user may select how many bds to allocate for the transmit and receive side of every scc. the user must initialize these entries before enabling the corre- sponding channel. furthermore, the user should not configure bd tables of two enabled sccs to overlap, or erratic operation will occur. note rbase and tbase should contain a value that is divisible by 8. 7.10.7.2 scc function code registers (rfcr, tfcr). there are eight separate function code registers for the four scc channels: four for receive data buffers (rfcrx) and four for transmit data buffers (tfcrx). the fc entry contains the value that the user would like to appear on the function code pins fc3?c0 when the associated sdma channel accesses memory. it also controls the byte-ordering convention to be used in the transfers. receive function code register table 7-5. scc parameter ram common to all protocols address name width description scc base + 00 rbase word rx bd base address scc base + 02 tbase word tx bd base address scc base + 04 rfcr byte rx function code scc base + 05 tfcr byte tx function code scc base + 06 mrblr word maximum receive buffer length scc base + 08 rstate long rx internal state scc base + 0c long rx internal data pointer scc base + 10 rbptr word rx bd pointer scc base + 12 word rx internal byte count scc base + 14 long rx temp scc base + 18 tstate long tx internal state scc base + 1c long tx internal data pointer scc base + 20 tbptr word tx bd pointer scc base + 22 word tx internal byte count scc base + 24 long tx temp scc base + 28 rcrc long temp receive crc scc base + 2c tcrc long temp transmit crc scc base + 30 first word of protocol-specific area scc base + xx last word of protocol-specific area 76543210 mot fc3?c0
serial communication controllers (sccs) 7-126 mc68360 user? manual motorola bits 7??eserved mot?otorola this bit should be set by the user to achieve normal operation. if this bit is modified on the fly, it will take effect at the beginning of the next frame (ethernet, hdlc, and transparent) or at the beginning of the next bd otherwise. mot must be set if the data buffer is located in external memory and has a 16-bit wide port size. 0 = intel convention is used for byte ordering?wapped operation. it is also called lit- tle-endian byte ordering. the bytes stored in each buffer word are reversed as compared to the motorola mode. 1 = motorola byte ordering?ormal operation. it is also called big-endian byte order- ing. as data is received from the serial line and put into the buffer, the most signif- icant byte of the buffer word contains data received earlier than the least significant byte of the same buffer word. fc3?c0?unction code 3? these bits contain the function code value used during this sdma channel? memory ac- cesses. it is suggested that the user write bit fc3 with a one, to identify this sdma chan- nel access as a dma-type access. example: fc3?c0 = 1000 (binary). do not write the value 0111 (binary) to these bits. transmit function code register bits 7??eserved mot?otorola this bit should be set by the user to achieve normal operation. if this bit is modified on the fly, it will take effect at the beginning of the next frame (ethernet, hdlc, and transparent) or at the beginning of the next bd otherwise. the mot must be set if the data buffer is located in external memory and has a 16-bit wide port size. 0 = intel convention is used for byte ordering?wapped operation. it is also called lit- tle-endian byte ordering. the transmission order of bytes within a buffer word is re- versed as compared to the motorola mode. 1 = motorola byte ordering?ormal operation. it is also called big-endian byte order- ing. as data is transmitted onto the serial line from the data buffer, the most signif- icant byte of the buffer word contains data to be transmitted earlier than the least significant byte of the same buffer word. note the mot must be set if the data buffer is located in external memory and has a 16-bit wide port size. 76543210 mot fc3?c0
serial communication controllers (sccs) motorola mc68360 user? manual 7-127 fc3?c0?unction code 3? these bits contain the function code value used during this sdma channel? memory ac- cesses. it is suggested that the user write bit fc3 with a one to identify this sdma channel access as a dma-type access. example: fc3?c0 = 1000 (binary). do not write the val- ue 0111 (binary) to these bits. 7.10.7.3 maximum receive buffer length register (mrblr). each scc has one mrblr to define the receive buffer length for that scc. mrblr defines the maximum number of bytes that the quicc will write to a receive buffer on that scc before moving to the next buffer. the quicc may write fewer bytes to the buffer than mrblr if a condition such as an error or end-of-frame occurs, but it will never write more bytes than the mrblr value. it follows, then, that buffers supplied by the user for use by the quicc should always be of size mrblr (or greater) in length. the transmit buffers for an scc are not affected in any way by the value programmed into mrblr. transmit buffers may be individually chosen to have varying lengths, as needed. the number of bytes to be transmitted is chosen by programming the data length field in the tx bd. note mrblr is not intended to be changed dynamically while an scc is operating. however, if it is modified in a single bus cycle with one 16-bit move (not two 8-bit bus cycles back-to-back), then a dynamic change in receive buffer length can be success- fully achieved. this takes place when the cp moves control to the next rx bd in the table. thus, a change to mrblr will not have an immediate effect. to guarantee the exact rx bd on which the change will occur, the user should change mrblr only while the scc receiver is disabled. the mrblr value should be greater than zero for all modes. for ethernet and hdlc the mrblr should be evenly divisible by 4. in totally transparent mode, mrblr should also be divisi- ble by 4, unless the receive fifo width (rfw) bit in gsmr is set to 8 bits. 7.10.7.4 receiver bd pointer (rbptr). the rbptr for each scc channel points to the next bd that the receiver will transfer data to when it is in idle state or to the current bd during frame processing. after a reset or when the end of the bd table is reached, the cp initializes this pointer to the value programmed in the rbase entry. although rbptr need never be written by the user in most applications, it may be modified by the user when the receiver is disabled or when the user is sure that no receive buffer is currently in use. 7.10.7.5 transmitter bd pointer (tbptr). the tbptr for each scc channel points to the next bd that the transmitter will transfer data from when it is in idle state or to the current bd during frame transmission. after a reset or when the end of the bd table is reached, the cp initializes this pointer to the value programmed in the tbase entry.
serial communication controllers (sccs) 7-128 mc68360 user? manual motorola although tbptr need never be written by the user in most applications, it may be modified by the user when the transmitter is disabled or when the user is sure that no transmit buffer is currently in use (e.g., after stop transmit command is issued, or after a graceful stop transmit command is issued, and the frame completes its transmission.) 7.10.7.6 other general parameters. additional parameters are listed in table 7-5. these parameters do not need to be accessed by the user in normal operation, and are listed only because they may provide helpful information for experienced users and for debugging. the rx and tx internal data pointers are updated by the sdma channels to show the next address in the buffer to be accessed. the tx internal byte count is a down-count value that is initialized with the tx bd data length and decremented with every byte read by the sdma channels. the rx internal byte count is a down-count value that is initialized with the mrblr value and decremented with every byte written by the sdma channels. note to extract data from a partially full receive buffer, the close rx bd command may be used. the rx internal state, tx internal state, rx temp, tx temp, and reserved areas are for risc use only. 7.10.8 interrupts from the sccs interrupt handling for each of the scc channels is configured on a global (per channel) basis in the cpm interrupt pending register, cpm interrupt mask register, and cpm in service reg- ister. within each of these registers, one bit is used to either mask, enable, or report the presence of an interrupt in an scc channel. the interrupt priority between the four sccs is programmable in the cp interrupt configuration register. an scc interrupt may be caused by a number of events. to allow interrupt handling for these (scc-specific) events, further event registers are provided within the sccs. a number of events can cause the scc to interrupt the processor. the events differ slightly according to the protocol selected. for a detailed description of the events see the specific protocol paragraphs. these events are handled independently for each channel by the scc event register and the scc mask register. events that can cause interrupts due to the cts and cd modem lines are described in 7.14.9 port c pin functions. 7.10.8.1 scc event register (scce). the 16-bit scc event register is used to report events recognized by any of the sccs. on recognition of an event, the scc will set its cor- responding bit in the scc event register (regardless of the corresponding mask bit). the scc event register appears to the user as a memory-mapped register and may be read at any time. a bit is cleared by writing a one (writing a zero does not affect a bit? value). more than one bit may be cleared at a time. this register is cleared at reset.
serial communication controllers (sccs) motorola mc68360 user? manual 7-129 7.10.8.2 scc mask register (sccm). the 16-bit, read-write scc mask register allows the user to either enable or disable interrupt generation by the cp for specific events in each scc channel. note that an interrupt will only be generated if the scc interrupts in this chan- nel are enabled in the cpm interrupt mask register. if a bit in the scc mask register is zero, the cp will not proceed with its usual interrupt han- dling whenever that event occurs. anytime a bit in the scc mask register is set, a one in the corresponding bit in the scc event register will set the scc event bit in the cpm interrupt pending register. the bit position of the scc mask register is identical to that of the scc event register. 7.10.8.3 scc status register (sccs). the 8-bit, read-write scc status register allows the user to monitor real-time status conditions on the rxd line, such as flags, idle, and data carrier sense. it does not show the real-time status of the cts and cd pins. their real-time status is available in the port c parallel i/o. 7.10.9 scc initialization the sccs require a number of registers and parameters to be configured after a power-on reset. the following outline is the proper sequence for initializing the sccs, regardless of the protocol used. more detailed examples are given in the protocol sections. 1. write the parallel i/o ports to configure the i/o pins to connect to the sccs. 2. the sdcr (sdma configuration register) should be initialized to $0740, rather than being left at its default value of $0000. 3. write the port c registers to configure the cts and cd pins to be parallel i/o with interrupt capability or to be direct connections to the scc (if modem support is needed). 4. if the tsa is used, the si must be configured. see 7.8 serial interface with time slot assigner for a description of the steps required. if the scc is used in the nmsi mode, then the sicr must still be initialized. 5. write gsmr, but do not write the ent or enr bits yet. 6. write the psmr. 7. write dsr. 8. initialize the required values for this scc in its parameter ram. 9. clear out any current events in the scce, if desired. 10. write sccm to enable the interrupts in the scce. 11. 1write cicr to configure the scc? interrupt priority. 12. 1clear out any current interrupts in cipr, if desired. 13. 1write cimr to enable interrupts to the cp interrupt controller. 14. 1set the ent and enr bits in the gsmr. the bds may have their ready/empty bits set at any time. notice that the cr does not need to be accessed following a power-on reset. an scc should be disabled and reenabled after
serial communication controllers (sccs) 7-130 mc68360 user? manual motorola any dynamic change in its parallel i/o ports or serial channel physical interface configura- tion. a full reset using the rst bit in the cr is a comprehensive reset that may also be used. 7.10.10 scc interrupt handling the following describes what would normally take place within an interrupt handler for the scc. 1. once an interrupt occurs, the scce should be read by the user to see which sources have caused interrupts. the scce bits that are going to be "handled" in this interrupt handler would normally be cleared at this time. 2. process the tx bds to reuse them if the tx bit or txe bit was set in scce. if the trans- mit speed is fast or the interrupt delay is long, more than one transmit buffer may have been sent by the scc. thus, it is important to check more than just one tx bd during the interrupt handler. one common practice is to process all tx bds in the interrupt handler until one is found with its r-bit set. 3. extract data from the rx bd if the rx, rxb, or rxf bit was set in scce. if the receive speed is fast or the interrupt delay is long, more than one receive buffer may have been received by the scc. thus, it is important to check more than just one rx bd during the interrupt handler. one common practice is to process all rx bds in the in- terrupt handler until one is found with its e-bit set. 4. clear the sccx bit in the cisr. 5. execute the rte instruction. 7.10.11 scc timing control when the diag bits of the gsmr are programmed to normal operation, the cd and cts lines are controlled automatically by the scc. the following paragraphs describe the behav- ior in this mode. in the following description, the tci bit in the gsmr is assumed to be cleared, implying normal transmit clock operation. 7.10.11.1 synchronous protocols. the rts pin is asserted when the scc data is loaded into the transmit fifo and a falling transmit clock occurs. at this point, the scc begins transmitting the data, once the appropriate conditions occur on the cts pin. in all cases, the first bit of data is the first bit of the opening flag, sync pattern, or the preamble (if a preamble was programmed to be sent prior to the frame). figure 7-39 shows that the delay between rts and data is 0 bit times, regardless of the ctss bit in the gsmr. this operation assumes that the cts pin is already asserted to the scc or that the cts pin is reprogrammed to be a parallel i/o line, in which case the cts signal to the scc is always asserted. rts is negated one clock after the last bit in the frame.
serial communication controllers (sccs) motorola mc68360 user? manual 7-131 figure 7-39. output delays from rts asserted for synchronous protocols if the cts pin is not already asserted when the rts pin is asserted, then the delays to the first bit of data depend on when cts is asserted. figure 7-40 shows the delay between cts and the data can be approximately 0.5 to 1 bit time or 0 bit times, depending on the ctss bit in the gsmr. txd rts cts first bit of frame data last bit of frame data (input) tclk (output) (output) notes: 1. a frame includes opening and closing flags and syncs, if present in the protocol.
serial communication controllers (sccs) 7-132 mc68360 user? manual motorola figure 7-40. output delays from cts asserted for synchronous protocols if the cts pin is programmed to envelope the data, the cts pin must remain asserted dur- ing frame transmission, or a cts lost error occurs (see figure 7-41). the negation of the cts pin forces the rts pin high, forcing the transmit data to the idle state. if the ctss bit in the gsmr is zero, the cts pin must be sampled by the scc before a cts lost is recog- nized. otherwise, the negation of cts immediately causes the cts lost condition. txd rts cts first bit of frame data last bit of frame data (input) tclk (output) (output) note: ctss = 1 in gsmr. ctsp is a don't care. txd rts cts first bit of frame data last bit of frame data (input) tclk (output) (output) note: ctss = 0 in gsmr. ctsp is a don't care. cts sampled low here
serial communication controllers (sccs) motorola mc68360 user? manual 7-133 figure 7-41. cts lost in synchronous protocols note if the ctss bit in gsmr is set, all cts transitions must occur while the transmit clock is low. reception delays are determined by the cd pin as shown in figure 7-42. if the cds bit in gsmr is zero, then the cd pin is sampled on the rising receive clock edge prior to data being received. if the cds bit in gsmr is one, then the cd pin transitions cause data to be immediately gated into the receiver. txd rts cts first bit of frame data (input) tclk (output) (output) note: ctss = 1 in gsmr. ctsp = 0 or no cts lost can occur. txd rts cts first bit of frame data (input) tclk (output) (output) note: ctss = 0 in gsmr. ctsp = 0 or no cts lost can occur. cts sampled low here cts sampled high here rts forced high data forced high cts lost signaled in frame bd cts lost signaled in frame bd rts forced high data forced high
serial communication controllers (sccs) 7-134 mc68360 user? manual motorola figure 7-42. using cd to control reception of synchronous protocols if the cd pin is programmed to envelope the data, the cd pin must remain asserted during frame transmission, or a cd lost error occurs. the negation of the cd pin terminates recep- tion. if the cds bit in the gsmr is zero, the cd pin must be sampled by the scc before a cd lost is recognized. otherwise, the negation of cd immediately causes the cd lost con- dition. note if the cds bit in gsmr is set, all cd transitions must occur while the receive clock is low. 7.10.11.2 asynchronous protocols. the rts pin is asserted when the scc data is loaded into the transmit fifo and a falling transmit clock occurs. the cd and cts pins may be used to control reception and transmission in the same manner as the synchronous protocols. the first bit of data transmission in an asynchronous protocol is the start bit of the first character. in addition, the uart protocol has an option for cts flow control as described in 7.10.16 uart controller. first bit of data in frame last bit of frame data rxd cd first bit of frame data last bit of frame data rclk (input) cd sampled low here (input) cd sampled high here rclk rxd (input) cd (input) cd assertion immediately gates reception cd negation immediately halts reception notes: 1. cds = 1 in gsmr; cdp = 0. 2. if cd is negated prior to the last bit of the receive frame, cd lost is signaled in the frame bd. 3. if cdp = 1, cd lost cannot occur, and cd negation has no effect on reception. notes: 1. cds = 0 in gsmr; cdp = 0. 2. if cd is negated prior to the last bit of the receive frame, cd lost is signaled in the frame bd. 3. if cdp = 1, cd lost cannot occur, and cd negation has no effect on reception.
serial communication controllers (sccs) motorola mc68360 user? manual 7-135 if cts is already asserted when rts is asserted, transmission begins in two additional bit times. if cts is not already asserted when rts is asserted and ctss = 0, then transmis- sion begins in three additional bit times. if cts is not already asserted when rts is asserted and ctss = 1, then transmission begins in two additional bit times. 7.10.12 digital phase-locked loop (dpll) dpll data encoding and dpll operations are discussed in the following paragraphs. 7.10.12.1 data encoding. each scc contains a dpll unit that may be programmed to encode and decode the scc data as nrz, nrzi mark, nrzi space, fm0, fm1, manches- ter, and differential manchester. examples of the different encoding methods are shown in figure 7-43. figure 7-43. dpll encoding examples if it is not desired to use the dpll, the nrz coding may be chosen by the user in the gsmr. the definition of the encodings are as follows: nrz a 1 is represented by a high level for the duration of the bit. a 0 is represented by a low level for the duration of the bit. nrzi mark a 1 is represented by no transition at all. a 0 is represented by a transition at the beginning of the bit (i.e., the level present in the preceding bit is reversed). nrzi spacea 1 is represented by a transition at the beginning of the bit (i.e., the level present in the preceding bit is reversed). nrz nrzi mark fm0 fm1 manchester 011 001 differential manchester nrzi space data
serial communication controllers (sccs) 7-136 mc68360 user? manual motorola a 0 is represented by no transition at all. fm0 a 1 is represented by a transition at the beginning of the bit only. a 0 is represented by a transition at the beginning of the bit and another transition at the center of the bit. fm1 a 1 is represented by a transition at the beginning of the bit and another transition at the center of the bit. a 0 is represented by a transition at the beginning of the bit only. manchestera 1 is represented by a high to low transition at the center of the bit. a 0 is represented by a low to high transition at the center of the bit. in both cases there may be a transition at the beginning of the bit to set up the level required to make the correct center transition. differential manchestera 1 is represented by a transition at the center of the bit with the opposite direction from the transition at the center of the preceding bit. a 0 is represented by a transition at the center of the bit with the same polarity from the transition at the center of the preceding bit. 7.10.12.2 dpll operation. each scc channel includes a dpll used to recover clock information from a received data stream. for applications that provide a direct clock source to the scc, the dpll may be bypassed as programmed in the gsmr. the dpll must not be used when an scc is programmed to ethernet. it is optional for other protocols. the dpll receive block diagram is shown in figure 7-44; the transmit block diagram is shown in figure 7-45.
serial communication controllers (sccs) motorola mc68360 user? manual 7-137 figure 7-44. dpll receive block diagram figure 7-45. dpll transmit block diagram the dpll is driven by either an external clock or one of the baud rate generator outputs. this clock should be approximately 8 , 16 ? or 32 times the data rate, depending on the encoding/decoding desired. the dpll uses this clock, along with the data stream, to con- 0 1 s x1 mode rclk hsrclk 0 1 s x1 mode sccrdata carrier snc noise hunting renc rdcr dpll receiver edge tsnc rinv rxd rxd rinv renc = nrzi hsrclk d q ck decoded data hsrclk 0 1 s x1 mode tclk hstclk hstclk txen hstclk txd 0 1 s x1 mode 0 1 s tenc = nrzi scct data tinv tenc tdcr tend hstclk dpll transmitter d q ck dq ck encode d data
serial communication controllers (sccs) 7-138 mc68360 user? manual motorola struct a data clock that may be used as the scc receive and/or transmit clock. in all modes, the dpll uses the input clock to determine the nominal bit time. at the beginning of operation, the dpll is in search mode. in this mode, the first transition resets the internal dpll counter and begins dpll operation. while the counter is counting, the dpll watches the incoming data stream for transitions. whenever a transition is detected, the dpll makes a count adjustment to produce an output clock that tracks the incoming bits. the dpll provides a carrier-sense signal. the carrier-sense signal indicates that there are data transfers on the rxd line. it is asserted as soon as a transition is detected on the rxd line, and it is negated after a programmable number of clocks have been detected with no transitions, using the tsnc bits in the gsmr. to prevent the dpll from locking on the wrong edges and to provide a fast synchronization, the dpll should generally receive a preamble pattern prior to the data. in some protocols, the preceding flags or syncs are used. however, some protocols require a special pattern, such as alternating ones and zeros. for the case of transmission, the scc has an option to generate preamble patterns as programmed in the tpp and tpl bits of the gsmr. notes: the quicc receiver require the above preambles. the dpll can also be used to invert the data stream on receive or transmit. this feature is available in all encodings, including the standard nrz data format. the dpll offers a choice on the transmitter during idle of whether to force the txd line to a high voltage or to continue encoding the data supplied to it. the dpll is used for the uart encoding/decoding. this gives the user the option of select- ing the divide ratio used in the uart decoding process (8, 16, or 32). typically, the 16 option is chosen by users. the maximum data rate that can be supported with the dpll is 3.125 mhz when working with a 25-mhz system clock, which assumes the 8 option is chosen: 25 mhz/8 = 3.125 mhz. thus, the frequency applied to the clkx pin or generated by an internal baud rate gen- erator may be up to 25 mhz on a 25-mhz quicc, if the dpll 8 , 16 , or 32 options are used. table 7-6. preamble requirement decoding method preamble pattern max preamble length required nrzi mark all zeros 8-bits nrzi space all ones 8-bits fm0 all ones 8-bits fm1 all zeros 8-bits manchester repeating 10's 8-bits differential manchester. all ones 8-bits
serial communication controllers (sccs) motorola mc68360 user? manual 7-139 note the 1:2 ratio of the syncclk to the serial clock does not apply when the dpll is used to recover the clock in the 8 , 16 , or 32 modes. the synchronization actually occurs internally after the receive clock is generated by the dpll; therefore, even the fast- est dpll clock generation (the 8 option) easily meets the re- quired 1:2 ratio clocking limit. 7.10.13 clock glitch detection a clock glitch occurs when an input clock signal transitions between a one and zero state twice, within a small enough time period to violate the minimum high/low time specification of the input clock. spikes are one type of glitch. additionally, glitches can occur when exces- sive noise is present on a slowly rising/falling signal. glitched clocks are a worry to many communications systems. not only can they cause sys- tems to experience errors, they can potentially cause errors to occur without even being detected by the system. systems that supply an external clock to a serial channel are often susceptible to glitches from situations such as noise, connecting/disconnecting the physical cable from the application board, or excessive ringing on the clock lines. the sccs on the quicc have a special circuit designed to detect glitches that may occur in the system. the glitch circuit is designed to detect glitches that could cause the scc to transition to the wrong state. this status information can be used to alert the system of a problem at the physical layer. the glitch detect circuit is not a specification test. thus, if the user develops a circuit that does not meet the input clocking specifications for the sccs, erroneous data may be received/transmitted that is not indicated by the glitch detection logic. conversely, if a glitch indication is signaled, it does not guarantee that erroneous data was received/transmitted. regardless of whether the dpll is used, the received clock is passed through a noise filter that eliminates any noise spikes that affect a single sample. this sampling is enabled with the gde bit of the gsmr. if a spike is detected, a maskable receive or transmit glitched clock interrupt is generated in the event register of the scc channel. although the user may choose to reset the scc receiver or transmitter or to continue operation, he should keep statistics on clock glitches for later evaluation. in addition, the glitched status indication may be used as a debugging aid during the early phases of prototype testing. 7.10.14 disabling the sccs on the fly if an scc is not needed for a period of time, it may be disabled and reenabled later. in this case, a sequence of operations is followed. these sequences ensure that any buffers in use will be properly closed and that new data will be transferred to/from a new buffer. such a sequence is required if the parameters that must be changed are not allowed to be changed dynamically. if the register or bit description
serial communication controllers (sccs) 7-140 mc68360 user? manual motorola states that dynamic changes are allowed, the following sequences are not required, and the register or bit may be changed immediately. in all other cases, the sequence should be used. for instance, the internal baud rate generators allow on-the-fly changes, but the dpll-related bits in the gsmr do not. note the modification of parameter ram does not require a full dis- abling of the scc. see the parameter ram description for de- tails on when parameter ram values may be modified. if the user desires to disable all sccs, smcs, and the spi, then the cr may be used to reset the entire cp with a single com- mand. 7.10.14.1 scc transmitter full sequence. ?or the scc transmitter, the full dis- able and enable sequence is as follows: 1. stop transmit command. this command is recommended if the scc is currently in the process of transmitting data since it stops transmission in an orderly way. if the scc is not transmitting (e.g., no tx bds are ready or the graceful stop trans- mit command has been issued and has completed), then the stop transmit com- mand is not required. furthermore, if the tbptr will be overwritten by the user or the init tx parameters command will be executed, this command is not required. 2. clear the ent bit in the gsmr, which disables the scc transmitter and puts it in a reset state. 3. make modifications. the user may make modifications to the scc transmit parame- ters including the parameter ram. if the user desires to switch protocols or restore the scc transmit parameters to their initial state, the init tx parameters command may now be issued. 4. restart transmit command. this command is required if the init tx parame- ters command was not issued in step 3. 5. set the ent bit in the gsmr. transmission will now begin using the tx bd pointed to by the tbptr as soon as the tx bd r-bit is set. 7.10.14.2 scc transmitter shortcut sequence. ? shorter sequence is possible if the user desires to reinitialize the transmit parameters to the state they had after reset. this sequence is as follows: 1. clear the ent bit in the gsmr. 2. init tx parameters command. any additional modifications may now be made. 3. set the ent bit in the gsmr. 7.10.14.3 scc receiver full sequence. ?he full disable and enable sequence for the receiver is as follows: 1. clear the enr bit in the gsmr. reception will be aborted immediately. this disables the receiver of the scc and puts it in a reset state. 2. make modifications. the user may make modifications to the scc receive parameters
serial communication controllers (sccs) motorola mc68360 user? manual 7-141 including the parameter ram. if the user desires to switch protocols or restore the scc receive parameters to their initial state, the init rx parameters command may now be issued. 3. enter hunt mode command. this command is required if the init rx parame- ters command was not issued in step 2. 4. set the enr bit in the gsmr. reception will now begin immediately using the rx bd pointed to by the rbptr if the rx bd e-bit is set. 7.10.14.4 scc receiver shortcut sequence. ? shorter sequence is possible if the user desires to reinitialize the receive parameters to the state they had after reset. this sequence is as follows: 1. clear the enr bit in the gsmr. 2. init rx parameters command. any additional modifications may now be made. 3. set the enr bit in the gsmr. 7.10.14.5 switching protocols. ?ometimes the user desires to switch the protocol that the scc is executing (e.g., uart to hdlc) without resetting the board or affecting any other scc. this can be accomplished using only one command and a short num- ber of steps: 1. clear the ent and enr bits in the gsmr. 2. init tx and rx parameters command. this one command initializes both trans- mit and receive parameters. any additional modifications may now be made in the gsmr to change the protocol, etc. 3. set the ent and enr bits in the gsmr. the scc is enabled with the new protocol. 7.10.15 saving power when the ent and enr bits of an scc are cleared, that scc consumes a minimal amount of power. 7.10.16 uart controller many applications need a simple method of communicating low-speed data between equip- ment. the universal asynchronous receiver transmitter (uart) protocol is the de-facto stan- dard for such communications. the term asynchronous is used because it is not necessary to send clocking information with the data that is sent. uart links are typically 38400 baud or less in speed and are character oriented (i.e., the smallest unit of data that can be cor- rectly received or transmitted is a character). typical applications of asynchronous links are connections between terminals and computer equipment. even in applications where syn- chronous communications are required, the uart is often used for a local debugging port to run board debugger software. the character format of the uart protocol is shown in fig- ure 7-46.
serial communication controllers (sccs) 7-142 mc68360 user? manual motorola figure 7-46. uart character format since the transmitter and receiver work asynchronously, there is no need to connect trans- mit and receive clocks. instead, the receiver oversamples the incoming data stream (usually by a factor of 16) and uses some of these samples to determine the bit value. traditionally the middle three samples of the sixteen samples are used. two uarts can communicate using a system like this if parameters, such as the parity scheme and character length, are the same for both transmitter and receiver. when data is not transmitted in the uart protocol, a continuous stream of ones is transmit- ted, called the idle condition. since the start bit is always a zero, the receiver can detect when real data is once again present on the line. uart also specifies an all-zeros character called a break, which is used to abort a character transfer sequence. many different protocols have been defined using asynchronous characters, but the most popular of these is the rs-232 standard. rs-232 specifies standard baud rates, handshak- ing protocols, and mechanical/electrical details. another popular standard using the same character format is rs-485, which defines a balanced line system allowing longer cables than rs-232 links. synchronous protocols like hdlc are sometimes defined to run over asynchronous links. other protocols like profibus extend the uart protocol to include lan- oriented features such as token passing. all the standards provide handshaking signals, but some systems require just three physical lines: transmit data, receive data, and ground. many proprietary standards have been built around the asynchronous character frame, and some even implement a multidrop configuration. in multidrop systems, more than two sta- tions may be present on a network, with each having a specific address. frames made up of many characters may be broadcast, with the first character acting as a destination address. to allow this, the uart frame is extended by one bit to distinguish between an address character and the normal data characters. additionally, a synchronous form of the uart protocol exists where start and stop bits are still present, but a clock is provided with each bit, so the oversampling technique is not required. this mode is called "isochronous" operation or, more often, synchronous uart. uart txd uart tclk 8 ,16 , or 32 start bit 5, 6, 7, or 8 data bits with the least significant bit first addr. bit par. bit optional 9/16 to 2 stop bits (clock not to scale)
serial communication controllers (sccs) motorola mc68360 user? manual 7-143 by appropriately setting the gsmr, any of the scc channels may be configured to function as a uart. the uart provides standard serial i/o using asynchronous character-oriented (start-stop) protocols with rs-232c-type lines. the uart may be used to communicate with any exist- ing rs-232-type device. the uart provides a port for serial communication to other microprocessors, terminals, etc., either locally or via modems. it includes facilities for communication using standard asynchronous bit rates and protocols. the uart supports a multidrop mode for master/ slave operation with wake-up capability on both idle line and address bit. the uart also supports a synchronous mode of operation where a clock must be provided with each bit received. the uart transmits data from memory (either internal or external) to the txd line and receives data from the rxd line into memory. in a synchronous uart mode, the clock must also be supplied. it may be generated internally or externally. modem lines are supported via the port c pins. the uart consists of separate transmit and receive sections whose operations are asyn- chronous with the cpu32+ core. 7.10.16.1 uart key features. ?he uart contains the following key features: flexible message-oriented data structure implements synchronous and asynchronous uart multidrop operation receiver wake-up on idle line or address mode eight control character comparison two address comparison maintenance of four 16-bit error counters received break character length indication programmable data length (5? bits) programmable 1 to 2 stop bits in transmission capable of reception without a stop bit programmable fractional stop bit length even/odd/force/no parity generation even/odd/force/no parity check frame error, noise error, break, and idle detection transmit preamble and break sequences freeze transmission option with low-latency stop 7.10.16.2 normal asynchronous mode. ?n a normal asynchronous mode, the re- ceive shift register receives the incoming data on the rxdx pin. the length and format
serial communication controllers (sccs) 7-144 mc68360 user? manual motorola of the uart character is defined by the control bits in the uart mode register. the order of reception is: 1. start bit 2. 5? data bits (lsb first) 3. address/data bit (optional) 4. parity bit (optional) 5. stop bits the receiver uses a clock 8, 16, or 32 times faster then the baud rate and samples each bit of the incoming data three times around its center. the value of the bit is determined by the majority of those samples. if the samples do not all agree, a noise indication counter is incre- mented. when a complete byte has been clocked in, the contents of the shift register are transferred to the uart receive data register. if there is an error in this character, then the appropriate error bits will be set by the cp. the uart may receive fractional stop bits. the next character? start bit may begin anytime after the three middle samples have been taken. the uart transmit shift register transmits the outgoing data on the txdx pin. data is clocked synchronously with the transmit clock, which may have either an internal or external source. the order of bit transmission is lsb first. only the data portion of the uart frame is actually stored in the data buffers. the start and stop bits are always generated and stripped by the uart controller. the parity bit may also be generated in transmission and checked during reception. although parity is not stored in the data buffer, its value may be inferred from the reporting mechanism in the data buffer (i.e., character with parity errors are identified). similarly, the optional address bit is not stored in the transmit or receive data buffer, but is implied from the buffer descriptor itself. parity is generated and checked for the address bit, when present. the rfw bit in the gsmr must be set for an 8-bit receive fifo for the uart receiver. 7.10.16.3 synchronous mode. in synchronous mode, the uart controller uses the 1 data clock for timing. the receive shift register receives the incoming data on the rxd pin synchronously to the clock. the length and format of the serial word in bits are defined by the control bits in the uart mode register in the same manner as for asynchronous mode. when a complete byte has been clocked in, the contents of the shift register are transferred to the uart receive data register. if there is an error in this character, then the appropriate error bits will be set by the cp. the uart transmit shift register transmits the outgoing data on the txd pin. data is clocked synchronously with the transmit clock, which may have either an internal or external source. the rfw bit in the gsmr must be set for an 8-bit receive fifo for the uart receiver.
serial communication controllers (sccs) motorola mc68360 user? manual 7-145 7.10.16.4 uart memory map. when configured to operate in uart mode, the quicc overlays the structure listed in table 7-5 with the uart-specific parameters described in table 7-7. note: the boldface items should be initialized by the user. max_idl. once a character is received on the line, the uart controller begins counting any idle characters received. if a max_idl number of idle characters is received before the next data character is received, an idle timeout occurs, and the buffer is closed. this in turn can produce an interrupt request to the cpu32+ core to receive the data from the buffer. thus, max_idl provides a convenient way to demarcate frames in the uart mode. to disable the max_idl feature, simply program it to $0000. a character of idle is calculated as the following number of bit times: 1 + data length (5, 6, 7, 8, or 9) + 1 (if parity bit is used) + number of stop bits (1 or 2). example: for 8 data bits, no parity, and 1 stop bit, the character length is 10 bits. table 7-7. uart-specific parameters address name width description scc base + 30 res long reserved scc base + 34 res long reserved scc base + 38 max_idl word maximum idle characters scc base + 3a idlc word temporary idle counter scc base + 3c brkcr word break count register (transmit) scc base + 3e parec word receive parity error counter scc base + 40 frmec word receive framing error counter scc base + 42 nosec word receive noise counter scc base + 44 brkec word receive break condition counter scc base + 46 brkln word last received break length scc base + 48 uaddr1 word uart address character 1 scc base + 4a uaddr2 word uart address character 2 scc base + 4c rtemp word temp storage scc base + 4e toseq word transmit out-of-sequence character scc base + 50 character1 word control character 1 scc base + 52 character2 word control character 2 scc base + 54 character3 word control character 3 scc base + 56 character4 word control character 4 scc base + 58 character5 word control character 5 scc base + 5a character6 word control character 6 scc base + 5c character7 word control character 7 scc base + 5e character8 word control character 8 scc base + 60 rccm word receive control character mask scc base + 62 rccr word receive control character register scc base + 64 rlbc word receive last break character
serial communication controllers (sccs) 7-146 mc68360 user? manual motorola idlc. this value is used by the risc to store the current idle counter value in the max_idl timeout process. idlc is a down-counter; it does not need to be initialized or accessed by the user. brkcr. the uart controller will send an a break character sequence whenever a stop transmit command is given. the number of break characters sent by the uart controller is determined by the value in brkcr. in the case of 8 data bits, no parity, 1 stop bit, and 1 start bit, each break character is 10 bits in length and consists of all zeros. parec, frmec, nosec, and brkec. these 16-bit (modulo? 16 ) counters are initialized by the user. when the associated condition occurs, they will be incremented by the risc controller. parec counts received parity errors. frmec counts received characters with framing errors. nosec counts received characters with noise errors (one of the three sam- ples was different). brkec counts the number of break conditions that occurred on the line. note that one break condition may last for hundreds of bit times, yet this counter is incre- mented only once during that period. brkln. this value is used to store the length of the last break character received. this value is the length in characters of the break. example: if the receive pin is low for 20 bit times, brkln will show the value $0010. brkln is accurate to within one character unit of bits. for example, for 8 data bits, no parity, 1 stop bit, and 1 start bit, brkln is accurate to within 10 bits. uaddr1, uaddr2. in the multidrop mode, the uart controller can provide automatic address recognition of two addresses. in this case, the lower order bytes of uaddr1 and uaddr2 are programmed by the user with the two desired addresses. toseq. this value is used to transmit out-of-sequence characters in the transmit stream such as the xoff and xon characters. using this field, the desired characters can be inserted into the transmit fifo without affecting any transmit buffer that might currently be in progress. character1?. these characters define the receive control characters on which inter- rupts may be generated. rccm. this value is used to mask the comparison of character1? so that classes of control characters may be defined. a one enables the bit comparison, a zero masks it. rccr. this value is used to hold the value of any control character that is not to be written to the data buffer. rlbc. this entry is used in synchronous uart, when the rzs bit is set in the psmr. this entry contains the actual pattern of the last break character. by counting the zeros in this entry, the cpu32+ core can measure the break length to a bit resolution. the user reads rlbc by counting the number of zeros written, starting at bit 15 down to the point where the first one is written. therefore, rlbc = 001xxxxxxxxxxxxx (binary) indicates two zeros, and rlbc = 1xxxxxxxxxxxxxxx (binary) indicates no zeros.
serial communication controllers (sccs) motorola mc68360 user? manual 7-147 7.10.16.5 uart programming model. an scc configured as a uart uses the same data structure as in the other modes. the uart data structure supports multibuffer opera- tion. the uart may be programmed to perform address comparison whereby messages not destined for a given programmable address are discarded. also, the user can program the uart to accept or reject control characters. if a control character is rejected, an interrupt may be generated. the receive character may be accepted using a receive character mask value. the uart enables the user to transmit break and preamble sequences. overrun, parity, noise, and framing errors are reported via the bd table and/or error counters. an indi- cation of the status of the line (idle) is reported through the status register, and a maskable interrupt is generated upon a status change. in its simplest form, the uart can function in a character-oriented environment. each character is transmitted with accompanied stop bits and parity (as configured by the user) and received into separate 1-byte buffers. reception of each buffer may generate a maskable interrupt. many applications may want to take advantage of the message-oriented capabilities sup- ported by the uart by using linked buffers (in either receive or transmit). in this case, data is handled in a message-oriented environment; users can work on entire messages rather than operating on a character-by-character basis. a message may span several linked buff- ers. for example, before handling the input data, a terminal driver may wish to wait until an end-of-line character has been typed by the user rather than being interrupted upon the reception of each character. as another example, when transmitting ascii files, the data may be transferred as mes- sages ending on the end-of-line character. each message could be both transmitted and received as a linked list of buffers without any intervention from the cpu32+, which achieves ease in programming and significant savings in processor overhead. on the receive side, the user may define up to eight control characters. each control char- acter may be configured to designate the end of a message or generate a maskable inter- rupt without being stored in the data buffer. the latter option is useful when flow control characters such as xon or xoff need to alert the cpu32+, yet do not belong to the mes- sage being received. 7.10.16.6 uart command set. the following transmit and receive commands are issued to the cr. 7.10.16.6.1 transmit commands. the following paragraphs describe the uart transmit commands. stop transmit command . after a hardware or software reset and the enabling of the channel in the scc mode register, the channel is in the transmit enable mode and starts polling the first bd in the table every 8 transmit clocks (immediately if the tod bit in the todr is set). the stop transmit command disables the transmission of characters on the transmit channel. if this command is received by the uart controller during message transmission, transmission of that message is aborted. the uart completes transmission of all data
serial communication controllers (sccs) 7-148 mc68360 user? manual motorola already transferred to its fifo and then stops transmitting data. the tbptr is not advanced. the uart transmitter will transmit a programmable number of break sequences and then start to transmit idles. the number of break sequences (which may be zero) should be writ- ten to the break count register before this command is given to the uart controller. graceful stop transmit command . the graceful stop transmit command is used to stop transmission in an orderly way rather than abruptly, as performed by the reg- ular stop transmit command. it stops transmission after the current buffer has com- pleted transmission, or immediately if there is no buffer being transmitted. the gra bit in the scce will be set once transmission has stopped. after transmission ceases, the uart transmit parameters, including bds, may be modified. the tbptr will point to the next tx bd in the table. transmission will begin once the r-bit of the next bd is set and the restart transmit command is issued. restart transmit command . the restart transmit command enables the trans- mission of characters on the transmit channel. this command is expected by the uart con- troller after disabling the channel in its scc mode register, after a stop transmit command, after a graceful stop transmit command, or after a transmitter error (underrun or cts lost). the uart controller will resume transmission from the current tbptr in the channel? tx bd table. init tx parameters command. this command initializes all transmit parameters in this serial channel? parameter ram to their reset state. this command should only be issued when the transmitter is disabled. note that the init tx; and rx parameters command may also be used to reset both transmit and receive parameters. 7.10.16.6.2 receive commands. the following paragraphs describe the uart receive commands. enter hunt mode enter hunt mode;command . after a hardware or software reset and the enabling of the channel in the scc mode register, the channel is in receive enable mode and will use the first bd in the table. the enter hunt mode command is used to force the uart controller to close the cur- rent rx bd if it is being used and enter the hunt mode. the uart controller will resume reception to the next bd if a message was in progress. in the multidrop hunt mode, the uart controller continually scans the input data stream for the address character. when not in multidrop mode, the uart controller will wait for the idle sequence (one character of idle) without losing any data that was in the receive fifo when this command was executed. close rx bd command . the close rx bd command is used to force the scc to close the rx bd, if it is currently being used, and to use the next bd for any subsequent data that is received. if the scc is not in the process of receiving data, no action is taken by this com- mand.
serial communication controllers (sccs) motorola mc68360 user? manual 7-149 note the close rx bd command in uart mode does the same job as the enter hunt mode command except for one distinc- tion. the close rx bd does not require that a character of idle be present on the line for reception to continue. init rx parameters command. this command initializes all receive parameters in this serial channel? parameter ram to their reset state. this command should only be issued when the receiver is disabled. note that the init tx and rx parameters command may also be used to reset both receive and transmit parameters. 7.10.16.7 uart address recognition (receiver). in multidrop systems, more than two stations may be present on a network, each having a specific address. figure 7- 47 shows two examples of such a configuration. frames made up of many characters may be broadcast, with the first character acting as a destination address. to achieve this, the uart frame is extended by one bit, called the address bit, to distinguish between an address character, and the normal data characters. the uart can be configured to operate in a multidrop environment in which the following two modes are supported: automatic multidrop mode the uart controller automatically checks the incoming address character and accepts the data following it only if the address matches one of two preset values. nonautomatic multidrop mode the uart controller receives all characters. an address character is always written to a new buffer (it may be followed by data characters). each uart controller has two 16-bit address registers to support address recognition, uaddr1 and uaddr2. the upper 8 bits of these registers should be written with zero; only the lower 8 bits are used. in the automatic mode, the incoming address is checked against uaddr1 and uaddr2. upon an address match, the m-bit in the bd is set to indicate which address character was matched, and the data following it is written to the data buffers. note for less than 8-bit characters, the msbs should be zero.
serial communication controllers (sccs) 7-150 mc68360 user? manual motorola figure 7-47. two configurations of uart multidrop operation 7.10.16.8 uart control characters (receiver). the uart has the capability to recognize special control characters. these characters may be used when the uart func- tions in a message-oriented environment. up to 8 control characters may be defined by the user in the control characters table. each character may be either written to the receive buffer (upon which the buffer is closed and a new receive buffer taken) or rejected. if rejected, the character is written to the received control character register (rccr) in internal ram, and a maskable interrupt is generated. this method is useful for notifying the user of the arrival of control characters (e.g., xoff) that are not part of the received messages. the uart uses a table of 16-bit entries to support control character recognition. each entry consists of the control character, a valid bit, and a reject character bit. 15 14 13 12 11 10 9 8 7 0 offset + 0 e r character1 offset + 2 e r character2 offset + 4 e r character3 offset + e e r character8 offset + 10 1 1 rccm offset + 12 rccr uaddr1 uaddr2 tr tr tr tr 1 2 3 4 t r tr tr tr master slave 1 slave 2 slave 3 two 8-bit addresses can be automatically recognized in either configuration. choose wired-or operation in the port a open-drain register to allow multiple transmit pins to be directly connected. r +v r +v paodr
serial communication controllers (sccs) motorola mc68360 user? manual 7-151 e?nd of table 0 = this entry is valid. the lower 8 bits will be checked against the incoming character. 1 = the entry is not valid. this must be the last entry in the control characters table. in tables with 8 control characters, e is always zero. r?eject character 0 = the character is not rejected but is written into the receive buffer. the buffer is then closed, and a new receive buffer is used if there is more data in the message. a maskable (i-bit in the rx bd) interrupt is generated. 1 = if this character is recognized, it will not be written to the receive buffer. instead, it is written to the rccr, and a maskable interrupt is generated. the current buffer is not closed when a control character is received with r set. character1??ontrol character values these fields define control characters that should be compared to the incoming character. for less than 8-bit characters, the msb should be zero. rccm?eceived control character mask the value in this register is used to mask the comparison of character1?. the lower eight bits of rccm correspond to the lower eight bits of character1? and are decod- ed as follows: 0 = mask this bit in the comparison of the incoming character and character1?. 1 = the address comparison on this bit proceeds normally; no masking occurs. bits 15 and 14 of rccm must be set, or erratic operation may occur during the control character recognition process. rccr?eceived control character register upon a control character match for which the reject bit is set, the uart will write the con- trol character into the rccr and generate a maskable interrupt. the cpu32+ core must process the interrupt and read the rccr before a second control character arrives. fail- ure to do so will result in the uart overwriting the first control character. 7.10.16.9 wake-up timer (receiver). by issuing the enter hunt mode command, the user can temporarily disable the uart receiver. it will remain inactive until an idle or address character is recognized (depending on the setting of the um bits). if the uart is still in the process of receiving a message that the user has already decided to discard, the user may abort its reception by issuing the enter hunt mode command. the uart receiver will be reenabled when the message is finished by detecting the idle line (one character of idle) or by the address bit of the next message, depending on the um bits. when the receiver is in sleep mode and a break sequence is received, the receiver will incre- ment the brkec counter and generate the brk interrupt if it is enabled. 7.10.16.10 break support (receiver). the uart offers very flexible break support for the receiver.
serial communication controllers (sccs) 7-152 mc68360 user? manual motorola transmission of out-of-sequence characters is also supported by the uart and is normally used for the transmission of flow control characters such as xon or xoff. this procedure is performed using the toseq entry in the uart parameter ram. the uart will poll toseq whenever the transmitter is enabled for uart operation. this includes during uart freeze operation, during uart buffer transmission, and when no buffer is ready for transmission. the toseq character is transmitted at a higher priority than the other characters in the transmit buffer (if any), but does not preempt characters already in the transmit fifo. this means that the xon or xoff character may not be transmitted for eight character times (scc1) or four character times (scc2, scc3, and scc4). to reduce this latency, the tfl bit in the gsmr should be set to decrease the fifo size to one character prior to enabling the scc transmitter. bits 15?4?on't care. may be written with ones or zeros. the fact that these bits are don? cares allows full compatibility between toseq on the quicc and character8 on the mc68302. rea?eady this bit is set by the cpu32+ core when the character is ready for transmission and will remain one while the character is being transmitted. the cp clears this bit after transmis- sion. i?nterrupt if set, the cpu32+ core will be interrupted when this character has been transmitted. (the tx bit will be set in the uart event register.) ct?lear-to-send lost this status bit indicates that the cts signal was negated during transmission of this char- acter. if this occurs, the cts bit in the uart event register will also be set. this bit oper- ates only if the cts line is monitored by the scc as determined by the diag bits. note if the cts signal was negated during transmission and the cp transmits this character in the middle of buffer transmission, the cts signal could actually have been negated either during this character? transmission or during a buffer character? transmis- sion. in this case, the cp sets the ct bit both here and in the tx bd status word. 1514131211109876543210 rea i ct 0 0 a charsend
serial communication controllers (sccs) motorola mc68360 user? manual 7-153 bits 10??hould be written with zeros. a?ddress when working in a multidrop configuration, the user should include the address bit in this position. charsend this value contains the character to be transmitted. any 5-, 6-, 7-, or 8-bit character value may be transmitted in accordance with the uart? configuration. the character should comprise the lsbs of charsend. this value may be modified only while the rea bit is cleared. 7.10.16.11 send break (transmitter). a break is an all-zeros character without a stop bit(s). a break is sent by issuing the stop transmit command. the uart com- pletes transmission of any outstanding data, sends a programmable number of break char- acters according to the break count register, and then reverts to idle or sends data if the restart transmit command was given before completion. at the completion of the break code, the transmitter sends at least one high bit before transmitting any data to guar- antee recognition of a valid start bit. the break characters do not preempt characters already in the transmit fifo. this means that the break character may not be transmitted for 8 character times (scc1) or 4 character times (scc2, scc3, and scc4). to reduce this latency, the tfl bit in the gsmr should be set to decrease the fifo size to one character prior to enabling the scc transmitter. 7.10.16.12 sending a preamble (transmitter). a preamble sequence gives the programmer a convenient way of ensuring that the line goes idle before starting a new mes- sage. the preamble sequence length is constructed of consecutive ones of one character length. if the preamble bit in a bd is set, the scc will send a preamble sequence before transmitting that data buffer. example: for 8 data bits, no parity, 1 stop bit, and 1 start bit, a preamble of 10 ones would be sent before the first character in the buffer. 7.10.16.13 fractional stop bits (transmitter). the asynchronous uart trans- mitter can be programmed to transmit fractional stop bits. four bits in the scc data synchro- nization register (dsr) are used to program the length of the last stop bit transmitted. these dsr bits may be modified at any time. if two stop bits are transmitted, only the second one is affected. idle characters are always transmitted as full-length characters. 1514131211109876543210 0 fsb 11001111110
serial communication controllers (sccs) 7-154 mc68360 user? manual motorola in normal uart mode with 16 oversampling, the fsb bits (14?1) in the dsr are decoded as follows: 1111 = last transmitted stop bit 16/16 (the default value after reset) 1110 = last transmitted stop bit 15/16 1101 = last transmitted stop bit 14/16 1100 = last transmitted stop bit 13/16 1011 = last transmitted stop bit 12/16 1010 = last transmitted stop bit 11/16 1001 = last transmitted stop bit 10/16 1000 = last transmitted stop bit 9/16 0xxx = invalid. do not use. when the uart is configured for 32 oversampling, the fsb bits (14?1) in the dsr are decoded as follows: 1111 = last transmitted stop bit 32/32 (the default value after reset) 1110 = last transmitted stop bit 31/32 1101 = last transmitted stop bit 30/32 1100 = last transmitted stop bit 29/32 1011 = last transmitted stop bit 28/32 1010 = last transmitted stop bit 27/32 1001 = last transmitted stop bit 26/32 1000 = last transmitted stop bit 25/32 0111 = last transmitted stop bit 24/32 0110 = last transmitted stop bit 23/32 0101 = last transmitted stop bit 22/32 0100 = last transmitted stop bit 21/32 0011 = last transmitted stop bit 20/32 0010 = last transmitted stop bit 19/32 0001 = last transmitted stop bit 18/32 0000 = last transmitted stop bit 17/32 when the uart is configured for 8 oversampling, the fsb bits (14?1) in the dsr are de- coded as follows: 1111 = last transmitted stop bit 8/8 (the default value after reset) 1110 = last transmitted stop bit 7/8 1101 = last transmitted stop bit 6/8 1100 = last transmitted stop bit 5/8 10xx = invalid. do not use. 01xx = invalid. do not use. 00xx = invalid. do not use. the uart receiver can always receive fractional stop bits. the next character? start bit may begin at any time after the three middle samples of the stop bit have been taken. 7.10.16.14 uart error-handling procedure. the uart controller reports char- acter reception and transmission error conditions via the channel bds, the error counters,
serial communication controllers (sccs) motorola mc68360 user? manual 7-155 and the uart event register. the modem interface lines can be monitored by the port c pins. 7.10.16.14.1 transmission error. the following paragraph describes a uart transmis- sion error. cts lost during character transmission . when this error occurs, the channel stops trans- mission after finishing transmission of the current character from the buffer. the channel then sets the ct bit in the tx bd and generates the tx interrupt if it is not masked. the chan- nel will resume transmission after the restart transmit command is issued and the cts pin is asserted. note the uart also offers an asynchronous flow control option using cts that does not generate an error. see the flc bit in the psmr description. 7.10.16.14.2 reception errors. the following paragraphs describe various types of uart reception errors. overrun error . data is moved from the receive fifo to the data buffer when the first byte is received into the fifo. if a receiver fifo overrun occurs, the channel writes the received character into the internal fifo over the previous received character (previous character is lost.) the channel writes the received character to the buffer, closes the buffer, sets the ov bit in the rx bd, and generates the rx interrupt if it is enabled. in automatic multidrop mode, the receiver enters hunt mode immediately. cd lost during character reception . if this error occurs and the channel is using this pin to automatically control reception, the channel terminates character reception, closes the buffer, sets the cd bit in the rx bd, and generates the rx interrupt (if enabled). this error has the highest priority. the last character in the buffer is lost, and other errors are not checked. in automatic multidrop mode, the receiver enters hunt mode immediately. parity error . when a parity error occurs, the channel writes the received character to the buffer, closes the buffer, sets the pr bit in the rx bd, and generates the rx interrupt (if enabled). the channel also increments the parec counter. in automatic multidrop mode, the receiver enters hunt mode immediately. noise error . noise error is detected by the uart controller when the three samples taken on every bit are not identical. when this error occurs, the channel writes the received char- acter to the buffer and proceeds normally, but increments the nosec. note in the synchronous mode of the uart controller, this error can- not occur. idle sequence receive . an idle is detected when one character consisting of all ones is received. when the uart is receiving data into a receive buffer, and an idle is received, the
serial communication controllers (sccs) 7-156 mc68360 user? manual motorola channel counts the number of consecutive idle characters received. if the count reaches the value programmed into max_idl, the buffer is closed, and an rx interrupt is generated. if no receive buffer is open, this event does not generate an interrupt or any status information. the internal idle counter (idlc) is reset every time a character is received. note to disable the idle sequence function entirely, set the max_idl value to zero. framing error . a framing error is detected by the uart controller when a character is received with no stop bit. all framing errors are report by the uart controller, regardless of the uart mode. when this error occurs, the channel writes the received character to the buffer, closes the buffer, sets the fr bit in the bd, and generates the rx interrupt (if enabled). the channel also increments the frmec. when this error occurs, parity is not checked for this character. in automatic multidrop mode, the receiver enters hunt mode immediately. if the rzs bit is set in the uart mode register when the uart is in the synchronous mode (syn is set), then the receiver reports all framing errors, but continues reception with the assumption that the unexpected zero is really the start bit of the next character. if rzs is set, user software may not wish to consider a reported uart framing error as a true uart framing error, unless two or more framing errors occur within a short period of time. break sequence . the uart offers very flexible break support for the receiver. when the first break sequence is received (one or more all-zero characters), the uart increments the brkec and issues the break start (brks) event in the uart event register, which can gen- erate an interrupt (if enabled). the uart then measures the break length, and, when the break sequence is complete, writes the length to the brkln register. after the first one is received, the uart also issues the break end (brke) event in the uart event register, which can generate an interrupt (if enabled). if the uart was in the process of receiving characters when the break was received, it will also close the receive buffer, set the br bit in the rx bd, and write the rx bit in the event register, which can generate an interrupt (if enabled). if the rzs bit is set in the uart mode register when the uart is in the synchronous mode (syn is set), then a break sequence will be detected only after two successive break char- acters are received. 7.10.16.15 uart mode register (psmr). each psmr is a 16-bit, memory-mapped, read-write register that controls scc operation. when the scc is configured as a uart, this register is called the uart mode register. this register is cleared at reset. many of the psmr bits may be modified on the fly (i.e., while the receiver and transmitter are enabled). 1514131211109876543210 flc sl cl um frz rzs syn drt pen rpm tpm
serial communication controllers (sccs) motorola mc68360 user? manual 7-157 flc?low control 0 = normal operation. the gsmr and port c registers determine the mode of the cts pin. 1 = asynchronous flow control. when the cts pin is negated, the transmitter will stop transmitting at the end of the current character. (if cts is negated past the middle of the current character, the next full character may be sent, and then transmission will be stopped.) when cts is asserted once more, transmission will continue where it left off. no cts lost error will be reported. no characters except idles will be transmitted while cts is negated. sl?top length the sl bit selects the number of the stop bits transmitted by the uart. this bit may be modified on the fly. the receiver is always enabled for one stop bit unless the uart is in synchronous mode and the rzs bit is set. fractional stop bits are configured in the dsr. 0 = one stop bit 1 = two stop bits cl?haracter length the cl bits determine the number of data bits in the character, not including the optional parity or multidrop address bits. when less than an 8-bit character is used, the msbs in memory are written as zeros, and on transmission the msbs in memory are a don? care. these bits may be modified on the fly. 00 = 5 data bits 01 = 6 data bits 10 = 7 data bits 11 = 8 data bits um?art mode the uart mode bits select the protocol that is implemented over the async channel. these bits may be modified on the fly. 00 = normal uart operation. multidrop mode is disabled, and an idle-line wake-up is selected. in the idle-line wake-up mode, the uart receiver is reenabled by re- ceiving one character of all ones. 01 = multidrop non-automatic mode. in the multidrop mode, an additional address/data bit is transmitted with each character. the multidrop asynchronous modes are compatible with the mc68681 duart, the mc68hc11 sci, the dsp56000 sci, and the intel 8051 serial interface. the uart receiver is reenabled when the last data bit received in the character (i.e., the address bit) is a one. this means that the received character is an address that has to be processed by all inactive pro- cessors. the uart receives the address character and writes it to a new buffer. the cpu32+ core then compares the written address with its own address to de- cide whether to ignore or process the following characters. 10 = reserved 11 = multidrop automatic mode. in this mode, the cp automatically checks the address of the incoming address character using the uaddr1 and uaddr2 parameter
serial communication controllers (sccs) 7-158 mc68360 user? manual motorola ram values, and automatically accepts or discards the data that follows the ad- dress. frz?reeze transmission this bit allows the user to halt the uart transmitter and continue transmission from the same point at a later time. 0 = normal operation. if the uart was previously frozen, the uart resumes trans- mission from the next character in the same buffer that was frozen. 1 = the uart completes transmission of any data already transferred to the uart fifo (the number of characters depends on the tfl bit in the gsmr) and then freezes (stops transmitting data). after this bit is reset, transmission will proceed from the next character. rzs?eceive zero stop bits the rzs bit configures the uart receiver to receive data without stop bits. this config- uration is useful in v.14 applications where uart data is supplied synchronously and all stop bits of a particular character may be omitted for the purpose of across-network rate adaptation. rzs should only be set if the syn bit is also set. 0 = the receiver operates normally with at least one stop bit required between charac- ters. a framing error is issued upon a missing stop bit, and a break status is set if a character with all-zero data bits is received with a zero stop bit. 1 = the receiver will continue reception if a missing stop bit is detected. if the stop bit is a zero, then the next bit is considered as the first data bit of the next character. a framing error is issued if a stop bit is missing, but a break status will be reported only after back-to-back reception of two break characters without stop bits. syn?ynchronous mode 0 = normal asynchronous operation. note that the user would normally program the tenc and renc bits in the gsmr to nrz, and must select either 8 , 16 , or 32 in the rdcr and tdcr bits of the gsmr (16 is the recommended value for most applications). 1 = synchronous uart using 1 clock. note that the user would normally program the tenc and renc bits in the gsmr to nrz, and must select the rdcr and tdcr bits in the gsmr to be 1 mode. a one bit is transferred with each clock and is synchronous to the clock. (as with the other modes, the clock may be provided internally or externally.) this mode is sometimes referred to as isochronous operation of a uart channel. drt?isable receiver while transmitting 0 = normal operation 1 = while data is being transmitted by the scc, the receiver is disabled, being gated by the internal rts signal. this configuration is useful if the uart is configured onto a multidrop line and the user does not wish to receive his own transmission.
serial communication controllers (sccs) motorola mc68360 user? manual 7-159 bit 5?eserved pen?arity enable 0 = no parity 1 = parity is enabled and determined by the parity mode bits. rpm?eceiver parity mode the rpm bits select the type of parity check to be performed by the receiver. the rpm bits can be modified on the fly. 00 = odd parity 01 = low parity (always check for a zero in the parity bit position) 10 = even parity 11 = high parity (always check for a one in the parity bit position) when odd parity is selected, the transmitter will count the number of ones in the data word. if the total number of ones is not an odd number, the parity bit is set to one and thus produces an odd number. if the receiver counts an even number of ones, an error in trans- mission has occurred. in the same manner, for even parity, an even number must result from the calculation performed at both ends of the line. in high/low parity (sometimes called mark/space parity), if the parity bit is not high/low, a parity error is reported. note the receive parity errors cannot be disabled, but can be ignored if desired. tpm?ransmitter parity mode the tpm bits select the type of parity to be performed for the transmitter. the tpm bits can be modified on the fly. 00 = odd parity 01 = force low parity (always send a zero in the parity bit position) 10 = even parity 11 = force high parity (always send a one in the parity bit position) 7.10.16.16 uart receive buffer descriptor (rx bd). the cp reports informa- tion concerning the received data on a per-buffer basis via rx bds. the cp closes the current buffer, generates a maskable interrupt, and starts to receive data into the next buffer after one of the following events: 1. receiving a user-defined control character (when the reject bit = 0 in the control char- acter table entry) 2. detecting an error during message processing 3. detecting a full receive buffer 4. receiving a max_idl number of consecutive idle characters 5. issuing the enter hunt mode command 6. issuing the close rx bd command
serial communication controllers (sccs) 7-160 mc68360 user? manual motorola 7. receiving an address character when working in multidrop mode (the address char- acter is written to the next buffer for software comparison.) an example of the scc uart rx bd process is shown in figure 7-48. figure 7-48. scc uart rx bd example mrblr = 8 bytes for this smc buffer byte 1 byte 2 byte 8 etc. 8 bytes long idle period fourth character has framing error! 5 chars 10 chars characters received by uart time buffer byte 9 byte 10 8 bytes buffer byte 1 byte 2 8 bytes byte 4 has framing error buffer full byte 3 byte 4 error! e length 32-bit buffer pointer receive bd 0 status 0008 pointer 0 e length 32-bit buffer pointer receive bd 1 status 0002 pointer 0 1 id 0 id e length 32-bit buffer pointer receive bd 2 status 0004 pointer 0 id 0 fr 1 e length 32-bit buffer pointer receive bd 3 status xxxx pointer 1 buffer byte 5 8 bytes reception still in progress with this buffer present time idle timeout occurred empty empty additional bytes will be stored unless idle count expires (max_idl)
serial communication controllers (sccs) motorola mc68360 user? manual 7-161 note: entries in boldface must be initialized by the user. e?mpty 0 = the data buffer associated with this rx bd has been filled with received data, or data reception has been aborted due to an error condition. the cpu32+ core is free to examine or write to any fields of this rx bd. the cp will not use this bd again while the e-bit remains zero. 1 = the data buffer associated with this bd is empty, or reception is currently in progress. this rx bd and its associated receive buffer are owned by the cp. once the e-bit is set, the cpu32+ core should not write any fields of this rx bd. bits 14, 6, 2?eserved w?rap (final bd in table) 0 = this is not the last bd in the rx bd table. 1 = this is the last bd in the rx bd table. after this buffer has been used, the cp will receive incoming data into the first bd in the table (the bd pointed to by rbase). the number of rx bd s in this table is programmable and is determined only by the w-bit and the overall space constraints of the dual-port ram. i?nterrupt 0 = no interrupt is generated after this buffer has been filled. 1 = the rx bit in the uart event register will be set when this buffer has been com- pletely filled by the cp, indicating the need for the cpu32+ core to process the buffer. the rx bit can cause an interrupt if it is enabled. c?ontrol character 0 = this buffer does not contain a control character. 1 = this buffer contains a control character. the last byte in the buffer is one of the user-defined control characters. a?ddress 0 = the buffer contains data only. 1 = when working in non-automatic multidrop mode, this bit indicates that the first byte of this buffer contains an address byte. the address comparison should be imple- mented in software. in automatic multidrop mode, this bit indicates that the bd con- tains a message received immediately after an address recognized in uaddr1 or uaddr2. this address is not written into the receive buffer. 1514131211109876543210 offset + 0 e w i c a cm id am br fr pr ov cd offset + 2 data length offset + 4 rx data buffer pointer offset + 6
serial communication controllers (sccs) 7-162 mc68360 user? manual motorola cm?ontinuous mode 0 = normal operation. 1 = the e-bit is not cleared by the cp after this bd is closed, allowing the associated data buffer to be overwritten automatically when the cp next accesses this bd. however, the e-bit will be cleared if an error occurs during reception, regardless of the cm bit. id?uffer closed on reception of idles the buffer was closed due to the reception of the programmable number of consecutive idle sequences (defined in max_idl). am?ddress match this bit has meaning only if the address bit is set and the automatic multidrop mode was selected in the um bits. following an address match, this bit defines which address char- acter matched the user-defined address character, enabling the uart to receive data. 0 = the address matched the value in uaddr2. 1 = the address matched the value in uaddr1. br?reak received a break sequence was received while receiving data into this buffer. fr?raming error a character with a framing error was received and is located in the last byte of this buffer. a framing error is a character without a stop bit. a new receive buffer will be used for fur- ther data reception. pr?arity error a character with a parity error was received and is located in the last byte of this buffer. a new receive buffer will be used for further data reception. ov?verrun a receiver overrun occurred during message reception. cd?arrier detect lost the carrier detect signal was negated during message reception. data length data length is the number of octets written by the cp into this bd? data buffer. it is written by the cp once as the bd is closed. note the actual amount of memory allocated for this buffer should be greater than or equal to the contents of the mrblr.
serial communication controllers (sccs) motorola mc68360 user? manual 7-163 rx data buffer pointer the receive buffer pointer, which always points to the first location of the associated data buffer, may be even or odd. the buffer may reside in either internal or external memory. 7.10.16.17 uart transmit buffer descriptor (tx bd). data is presented to the cp for transmission on an scc channel by arranging it in buffers referenced by the chan- nel? tx bd table. the cp confirms transmission or indicates error conditions via the bds to inform the processor that the buffers have been serviced. note: entries in boldface must be initialized by the user. r?eady 0 = the data buffer associated with this bd is not ready for transmission. the user is free to manipulate this bd or its associated data buffer. the cp clears this bit after the buffer has been transmitted or after an error condition is encountered. 1 = the data buffer, which has been prepared for transmission by the user, has not been transmitted or is currently being transmitted. no fields of this bd may be writ- ten by the user once this bit is set. w?rap (final bd in table) 0 = this is not the last bd in the tx bd table. 1 = this is the last bd in the txbd in the table. after this buffer has been used, the cp will transmit data from the first bd in the table (the bd pointed to by tbase). the number of tx bds in this table is programmable, and is determined only by the w- bit and the overall space constraints of the dual-port ram. i?nterrupt 0 = no interrupt is generated after this buffer has been serviced. 1 = the tx bit in the uart event register will be set when this buffer has been serviced by the cp, which can cause an interrupt. cr?lear-to-send report this bit allows a choice of either no delay between buffers transmitted in uart mode, or a more accurate cts lost error reporting and three bits of idle between buffers. 0 = the buffer following this buffer will be transmitted with no delay (assuming it is ready), but the ct bit may not be set in the correct tx bd or may not be set at all in a cts lost condition. asynchronous flow control, however, continues to function normally. 1 = normal cts lost (ct bit) error reporting, and three bits of idle occur between back- to-back buffers. 1514131211109876543210 offset + 0 r w i cr a cm p ns ct offset + 2 data length offset + 4 tx data buffer pointer offset + 6
serial communication controllers (sccs) 7-164 mc68360 user? manual motorola a?ddress this bit is valid only in multidrop mode (either automatic or non-automatic). 0 = this buffer contains data only. 1 = set by the cpu32+ core, this bit indicates that this buffer contains address char- acter(s). all the buffer? data will be transmitted as address characters. cm?ontinuous mode 0 = normal operation. 1 = the r-bit is not cleared by the cp after this bd is closed, allowing the associated data buffer to be retransmitted automatically when the cp next accesses this bd. however, the r-bit will be cleared if an error occurs during transmission, regard- less of the cm bit. p?reamble 0 = no preamble sequence is sent. 1 = the uart sends one character of all ones before sending the data so that the oth- er end will detect an idle line before the data. if this bit is set and the data length of this bd is zero, only a preamble will be sent. ns?o stop bit transmitted 0 = normal operation. stop bits are sent with all characters in this buffer. 1 = the data in this buffer will be sent without stop bits if the sync mode is selected by setting the syn bit in the psmr. if async is selected the stop bit is shaved according to the value of the dsr register. the following bit is written by the cp after it has finished transmitting the associated data buffer. ct?ts lost 0 = the cts signal remained asserted during transmission. 1 = the cts signal was negated during transmission. data length the data length is the number of octets that the cp should transmit from this bd? data buffer. it is never modified by the cp. normally, this value should be greater than zero. the data length may be equal to zero with the p-bit set, and only a preamble will be sent. tx data buffer pointer the transmit buffer pointer, which always points to the first location of the associated data buffer, may be even or odd. the buffer may reside in either internal or external memory. 7.10.16.18 uart event register (scce). the scce is called the uart event regis- ter when the scc is operating as a uart. it is a 16-bit register used to report events rec- ognized by the uart channel and to generate interrupts. on recognition of an event, the uart controller will set the corresponding bit in the uart event register. interrupts gener- ated by this register may be masked in the uart mask register. an example of interrupts that may be generated by the uart is shown in figure 7-49.
serial communication controllers (sccs) motorola mc68360 user? manual 7-165 figure 7-49. uart interrupt events example the uart event register is a memory-mapped register that may be read at any time. a bit is cleared by writing a one (writing a zero does not affect a bit? value). more than one bit may be cleared at a time. all unmasked bits must be cleared before the cp will clear the internal interrupt request. this register is cleared at reset. bits 15?3, 10, 4?eserved these bits should be written with zeros. glr?litch on rx a clock glitch was detected by this scc on the receive clock. 1514131211109876543210 glr glt ab idl gra brke brks ccr bsy tx rx line idle 10 characters characters received by uart time rxd cd line idle line idle 7 characters cts line idle txd rts idl rx cd cd rx ccr cts cts tx break brks notes: 1. the first rx event assumes receive buffers are 6 bytes each. 2. the second idl event occurs after an all-ones character is received. 3. the second rx event position is programmable based on the max_idl value. 4. the brks event occurs after the first break character is received. 5. the cd event must be programmed in the port c parallel i/o, not in the scc itself. notes: 1. tx event assumes all seven characters were put into a single buffer and cr = 1 in the tx bd. 2. the cts event must be programmed in the port c parallel i/o, not in the scc itself. uart scce events uart scce events characters transmitted by uart idl a receive control character defined not to be stored in the receive buffer. legend: idl idl brke
serial communication controllers (sccs) 7-166 mc68360 user? manual motorola glt?litch on tx a clock glitch was detected by this scc on the transmit clock. ab?uto baud an auto baud lock was detected. the cpu32+ core should rewrite the baud rate genera- tor with the precise divider value for the desired baud rate. see 7.9 baud rate generators (brgs) for more details. idl?dle sequence status changed a change in the status of the serial line was detected on the uart channel. the real-time status of the line may be read in sccs. idle is entered when one character of all ones is received. it is exited when a single zero is received. gra?raceful stop complete a graceful stop, which was initiated by the graceful stop transmit command, is now complete. this bit is set as soon the transmitter has finished transmitting any buffer that was in progress when the command was issued. it will be set immediately if no buffer was in progress when the command was issued. brke?reak end the end of a break sequence was detected. this indication will be set no sooner than after one idle bit is received following a break sequence. brks?reak start a break character was received. this is the first break of a break sequence. the user will not receive multiple brks events if a long break sequence is received. ccr?ontrol character received a control character was received (with reject (r) character = 1) and stored in the receive control character register (rccr). bsy?usy condition a character was received and discarded due to lack of buffers. if the multidrop mode is selected, the receiver automatically enters hunt mode immediately. otherwise, reception continues as soon as an empty buffer is provided. the latest that an rx bd can be made empty (have its e-bit set) and still guarantee avoiding the busy condition is the middle of the stop bit of the first character to be stored in that buffer. tx?x buffer a buffer has been transmitted over the uart channel. if cr = 1 in the tx bd, this bit is set no sooner than when the last stop bit of the last character in the buffer begins to be transmitted. if cr = 0, this bit is set after the last character was written to the transmit fifo. rx?x buffer a buffer has been received over the uart channel. this event occurs no sooner than the middle of the first stop bit of the character that caused the buffer to be closed.
serial communication controllers (sccs) motorola mc68360 user? manual 7-167 7.10.16.19 uart mask register (sccm). the sccm is referred to as the uart mask register when the scc is operating as a uart. it is a 16-bit read-write register with the same bit formats as the uart event register. if a bit in the uart mask register is a one, the cor- responding interrupt in the event register will be enabled. if the bit is zero, the corresponding interrupt in the event register will be masked. this register is cleared upon reset. 7.10.16.20 scc status register (sccs). the sccs is an 8-bit read-only register that allows the user to monitor real-time status conditions on the rxd line. the real-time status of the cts and cd pins are part of the port c parallel i/o. bits 7??eserved id?dle status id is set when the rxd pin has been a logic one for at least one full character time. 0 = the line is not currently idle. 1 = the line is currently idle. 7.10.16.21 scc uart example. the following list is an initialization sequence for 9600 baud, 8 data bits, no parity, and stop bit of an scc uart operation assuming a 25-mhz system frequency. brg1 and scc4 are used. the uart is configured with the rts4 , cts4 , and cd4 pins active. in addition, the cts4 pin is used as an automatic flow control signal. 1. the sdcr (sdma configuration register) should be initialized to $0740, rather than being left at its default value of $0000. 2. configure the port a pins to enable the txd4 and rxd4 pins. write papar bits 6 and 7 with ones. write padir bits 6 and 7 with zeros. write paodr bits 6 and 7 with zeros. 3. configure the port c pins to enable rts4 , cts4 , and cd4 . write pcpar bit 3 with one and bits 10 and 11 with zeros. write pcdir bits 3, 10, and 11 with zeros. write pcso bits 10 and 11 with ones. 4. configure brg1. write brgc1 with $010144. the div16 bit is not used, and the divider is 162 (decimal). the resulting brg1 clock is 16 the desired bit rate of the uart. 5. connect the brg1 clock to scc4 using the si. write the r4cs bits in sicr to 000. write the t4cs bits in sicr to 000. 6. program the cr to execute the init rx & tx params command for this channel. for instance, to execute this command for scc1, write $0001 to the cr. this com- mand causes the rbptr and tbptr parameters of the serial channel to be updated with the new values just programmed into rbase and tbase. 7. write $0740 to the sdcr to initialize the sdma configuration register. 8. connect the scc4 to the nmsi (i.e., its own set of pins). clear the sc4 bit in the 76543210 ?d
serial communication controllers (sccs) 7-168 mc68360 user? manual motorola sicr. 9. write rbase and tbase in the scc parameter ram to point to the rx bd and tx bd in the dual-port ram. assuming one rx bd at the beginning of dual-port ram and one tx bd following that rx bd, write rbase with $0000 and tbase with $0008. 10. program the cr to execute the init rx & tx params command for this channel. for instance, to execute this command for scc1, write $0001 to the cr. this com- mand causes the rbptr and tbptr parameters of the serial channel to be updated with the new values just programmed into rbase and tbase. 11. write rfcr with $15 and tfcr with $15 for normal operation. 12. write mrblr with the maximum number of bytes per receive buffer. for this case, assume 16 bytes, so mrblr = $0010. 13. write max_idl with $0000 in the scc uart-specific parameter ram to disable the max_idl functionality for this example. 14. set brkcr to $0001, so that if a stop transmit command is issued, one break character will be sent. 15. clear parec, frmec, nosec, and brkec in the scc uart-specific parameter ram for the sake of clarity. 16. clear uaddr1 and uaddr2. they are not used. 17. clear toseq. it is not used. 18. write character1? with $8000. they are not used. 19. write rccm with $c0ff. it is not used. 20. initialize the rx bd. assume the rx data buffer is at $00404000 in main memory. write $b000 to rx_bd_status. write $0000 to rx_bd_length (not required?one for instructional purposes only). write $00404000 to rx_bd_pointer. 21. initialize the tx bd. assume the tx data buffer is at $00404100 in main memory and contains five 8-bit characters. write $b000 to tx_bd_status. write $0010 to tx_bd_length. write $00404100 to tx_bd_pointer. 22. write $ffff to the scce to clear any previous events. 23. write $0003 to the sccm to enable the tx and rx interrupts. 24. write $08000000 to the cimr to allow scc4 to generate a system interrupt. (the cicr should also be initialized.) 25. write $00000020 to gsmr_h4 to configure a small receive fifo width. 26. write $00028004 to gsmr_l4 to configure 16 sampling for transmit and receive, the cts and cd pins to automatically control transmission and reception (dig bits), and the uart mode. notice that the transmitter (ent) and receiver (enr) have not been enabled yet. 27. set the psmr4 to $b000 to configure automatic flow control using the cts pin, 8-bit characters, no parity, 1 stop bit, and asynchronous uart operation. 28. write $00028034 to gsmr_l4 to enable the scc4 transmitter and receiver. this additional write ensures that the ent and enr bits will be enabled last.
serial communication controllers (sccs) motorola mc68360 user? manual 7-169 note after 16 bytes have been transmitted, the tx bd is closed. ad- ditionally, the receive buffer is closed after 16 bytes have been received. any additional receive data beyond 16 bytes will cause a busy (out-of-buffers) condition since only one rx bd was pre- pared. 7.10.16.22 s-records programming example. in the following paragraphs, an example of a downloading application is given that utilizes an scc channel as a uart con- troller. the application performs downloads and uploads of s-records between a host com- puter and an intelligent peripheral through a serial asynchronous line.; the s-records are strings of ascii characters that begin with ??and end in an end-of-line character. this characteristic will be used to impose a message structure on the communi- cation between the devices. note that each device may also transmit xon and xoff char- acters for flow control, which do not form part of the program being uploaded or downloaded. the uart mode register should be set as required, with the frz bit cleared and the ent and enr bits set. receive buffers should be linked to the receive buffer table with the inter- rupt (i) bit set. for simplicity, assume that the line is not multidrop (no addresses are trans- mitted) and that each s-record will fit into a single data buffer. three characters should first be entered into the uart control character table: 1. line feed?oth the e and r bits should be cleared. when an end-of-line character is received, the current buffer is closed (the next bd taken by the cp) and made avail- able to the cpu32+ core for processing. this buffer contains an entire s record, which the processor can now check and copy to memory or disk as required. 2. xoff? should be cleared, and r should be set. whenever the cpu32+ core re- ceives a control character received interrupt and the receive control character register contains xoff, the software should immediately stop transmitting to the other station by setting the frz bit in the uart mode register. this prevents data from being lost by the other station when it runs out of receive buffers. 3. xon?on should be received after xoff. e should be cleared, and r should be set. the frz bit on the transmitter should now be cleared. the cp automatically resumes transmission of the serial line at the point at which it was previously stopped. like xoff, the xon character is not stored in the receive buffer. to receive the s-records, the cpu32+ core must only wait for the rx interrupt, indicating the reception of a complete s-record buffer. transmission requires assembling s-records into data buffers and linking them to the transmit buffer table (transmission may be tempo- rarily halted by reception of an xoff character). this scheme minimizes the number of interrupts received by the cpu32+ core (one per s-record) and relieves it from the task of continually scanning for control characters. 7.10.17 hdlc controller layer 2 of the seven-layer osi model is the data link layer. one of the most common layer 2 protocols is hdlc. in fact, many other common layer 2 protocols are heavily based on
serial communication controllers (sccs) 7-170 mc68360 user? manual motorola hdlc, particularly the framing structure of hdlc: namely, sdlc, ss#7, appletalk, lapb, and lapd. the framing structure of hdlc is shown in figure 7-50. hdlc uses a zero insertion/deletion process (commonly known as bit-stuffing) to ensure that the bit pattern of the delimiter flag does not occur in the fields between flags. the hdlc frame is synchronous and therefore relies on the physical layer to provide a method of clock- ing and synchronizing the transmitter/receiver. since the layer 2 frame can be transmitted over a point-to-point link, a broadcast network, or packet and circuit switched systems, an address field is needed to carry the frame's des- tination address. the length of this field is commonly 0, 8, or 16 bits, depending on the data link layer protocol. for instance, sdlc and lapb use an 8-bit address. ss#7 has no address field at all because it is always used in point-to-point signaling links. lapd further divides its 16-bit address into different fields to specify various access points within one piece of equipment. it also defines a broadcast address. some hdlc-type protocols also allow for extended addressing beyond 16 bits. the 8 or 16-bit control field provides a flow control number and defines the frame type (con- trol or data). the exact use and structure of this field depends upon the protocol using the frame. data is transmitted in the data field, which can vary in length depending upon the protocol using the frame. layer 3 frames are carried in this data field. error control is implemented by appending a crc (crc) to the frame, which in most proto- cols is 16-bits long but may be as long as 32-bits. in hdlc, the lsb of each octet is transmitted first, and the msb of the crc is transmitted first. when the mode bits of the gsmr select the hdlc mode, then that scc functions as an hdlc controller. when an scc in hdlc mode is used with a nonmultiplexed modem inter- face, then the scc outputs are connected directly to the external pins. modem signals may be supported through the port c pins. the receive and transmit clocks can be supplied either from the bank of baud rate generators, by the dpll, or externally. the hdlc controller may also be connected to one of the two tdm channels of the serial interface and used with the tsa. the hdlc controller consists of separate transmit and receive sections whose operations are asynchronous with the cpu32+ core and may be either synchronous or asynchronous with respect to the other sccs. the user can allocate up to 196 bds for receive and transmit tasks so that many frames may be transmitted or received without host intervention. 7.10.17.1 hdlc controller key features. the hdlc contains the following key features: flexible data buffers with multiple buffers per frame separate interrupts for frames and buffers (receive and transmit) received frames threshold to reduce interrupt overhead
serial communication controllers (sccs) motorola mc68360 user? manual 7-171 may be used with the scc dpll four address comparison registers with mask maintenance of five 16-bit error counters flag/abort/idle generation/detection zero insertion/deletion 16-bit or 32-bit crc-ccitt generation/checking detection of nonoctet aligned frames detection of frames that are too long programmable flags (0?5) between successive frames automatic retransmission in case of collision 7.10.17.2 hdlc channel frame transmission processing. the hdlc trans- mitter is designed to work with almost no intervention from the cpu32+ core. when the cpu32+ core enables one of the transmitters, it will start transmitting flags or idles as pro- grammed in the hdlc mode register. the hdlc controller will poll the first bd in the trans- mit channel? bd table. when there is a frame to transmit, the hdlc controller will fetch the data from memory and start transmitting the frame (after first transmitting the user-specified minimum number of flags between frames). when the end of the current bd has been reached and the last buffer in the frame bit is set, the crc, if selected, and the closing flag are appended. in hdlc, the lsb of each octet is transmitted first, and the msb of the crc is transmitted first. a typical hdlc frame is shown in figure 7-50. figure 7-50. hdlc framing structure; following the transmission of the closing flag, the hdlc controller writes the frame status bits into the bd and clears the r-bit. when the end of the current bd has been reached and the last bit is not set (working in multibuffer mode), only the r-bit is cleared. in either mode, an interrupt may be issued if the i-bit in the tx bd is set. the hdlc controller will then pro- ceed to the next tx bd in the table. in this way, the user may be interrupted after each buffer, after a specific buffer has been transmitted, or after each frame. to rearrange the transmit queue before the cp has completed transmission of all buffers, issue the stop transmit command. this technique can be useful for transmitting expe- dited data before previously linked buffers or for error situations. when receiving the stop transmit command, the hdlc controller will abort the current frame being transmitted and start transmitting idles or flags. when the hdlc controller is given the restart transmit command, it resumes transmission. to insert a high-priority frame without aborting the current frame, the graceful stop transmit command may be issued. a special interrupt (gra) can be generated in the event register when the current frame is complete. opening flag address control information (optional) crc closing flag 8 bits 16 bits 8 bits 8n bits 16 bits 8 bits
serial communication controllers (sccs) 7-172 mc68360 user? manual motorola 7.10.17.3 hdlc channel frame reception processing. the hdlc receiver is also designed to work with almost no intervention from the cpu32+ core. the hdlc receiver can perform address recognition, crc checking, and maximum frame length checking. the received frame is available to the user for performing any hdlc-based pro- tocol. when the cpu32+ core enables one of the receivers, the receiver waits for an opening flag character. when the receiver detects the first byte of the frame, the hdlc controller will compare the frame address against the user-programmable addresses. the user has four 16-bit address registers and an address mask available for address matching. the hdlc controller will compare the received address field to the user-defined values after masking with the address mask. the hdlc controller can also detect broadcast (all ones) address frames, if one address register is written with all ones. if a match is detected, the hdlc controller will fetch the next bd and, if it is empty, will start to transfer the incoming frame to the bd? associated data buffer. when the data buffer has been filled, the hdlc controller clears the e-bit in the bd and generates an interrupt if the i-bit in the bd is set. if the incoming frame exceeds the length of the data buffer, the hdlc controller will fetch the next bd in the table and, if it is empty, will continue to transfer the rest of the frame to this bd? associated data buffer. during this process, the hdlc controller will check for a frame that is too long. when the frame ends, the crc field is checked against the recalculated value and is written to the data buffer. the data length written to the last bd in the hdlc frame is the length of the entire frame. this enables hdlc protocols that ?ose?frames to correctly recognize the frame-too-long condition. the hdlc controller then sets the last buffer in frame bit, writes the frame status bits into the bd, and clears the e-bit. the hdlc controller next generates a maskable interrupt, indicating that a frame has been received and is in memory. the hdlc controller then waits for a new frame. back-to-back frames may be received with only a single shared flag between frames. the user can configure the hdlc controller not to interrupt the cpu32+ core until a certain number of frames has been received. this is configured in the received frames threshold (rfthr) location of the parameter ram. the user can combine this function with a timer to implement a timeout if less than the threshold number of frames is received. 7.10.17.4 hdlc memory map. when configured to operate in hdlc mode, the quicc overlays the structure listed in table 7-5 with the hdlc-specific parameters described in table 7-8. table 7-8. hdlc-specific parameters address name width description scc base + 30 res long reserved scc base + 34 c_mask long crc constant scc base + 38 c_pres long crc preset scc base + 3c disfc word discard frame counter scc base + 3e crcec word crc error counter
serial communication controllers (sccs) motorola mc68360 user? manual 7-173 note: the boldfaced items should be initialized by the user. c_mask. for the 16-bit crc-ccitt, c_mask should be initialized with $0000f0b8. for the 32-bit crc-ccitt, c_mask should be initialized with $debb20e3. c_pres. for the 16-bit crc-ccitt, c_pres should be initialized with $0000ffff. for the 32-bit crc-ccitt, c_pres should be initialized with $ffffffff. disfc, crcec, abtsc, nmarc, and retrc. these 16-bit (modulo 2 16 ) counters are maintained by the cp. they may be initialized by the user while the channel is disabled. the counters are as follows: disfc discarded frame counter (error-free frames but no free buffers) crcec crc error counter (includes frames not addressed to the user or frames received in the bsy condition, but does not include overrun errors) abtsc abort sequence counter nmarc non-matching address received counter (error-free frames only) retrc frame retransmission counter (due to collision) mflr . the hdlc controller checks the length of an incoming hdlc frame against the user- defined value given in this 16-bit register. if this limit is exceeded, the remainder of the incoming hdlc frame is discarded, and the lg (rx frame too long) bit is set in the last bd belonging to that frame. the hdlc controller waits to the end of the frame and reports the frame status and the frame length in the last rx bd. mflr is defined as all the in-frame bytes between the opening flag and the closing flag (address, control, data, and crc). max_cnt is a temporary down-counter used to track the frame length. hmask, haddr1, haddr2, haddr3, and haddr4. each hdlc controller has five 16- bit registers for address recognition?ne mask register and four address registers. the hdlc controller reads the frame? address from the hdlc receiver, checks it against the four address register values, and then masks the result with the user-defined mask register. a one in the mask register represents a bit position for which address comparison should scc base + 40 abtsc word abort sequence counter scc base + 42 nmarc word nonmatching address rx counter scc base + 44 retrc word frame retransmission counter scc base + 46 mflr word max frame length register scc base + 48 max_cnt word max_length counter scc base + 4a rfthr word received frames threshold scc base + 4c rfcnt word received frames count scc base + 4e hmask word user-defined frame address mask scc base + 50 haddr1 word user-defined frame address scc base + 52 haddr2 word user-defined frame address scc base + 54 haddr3 word user-defined frame address scc base + 56 haddr4 word user-defined frame address scc base + 58 tmp word temp storage scc base + 5a tmp_mb word temp storage table 7-8. hdlc-specific parameters
serial communication controllers (sccs) 7-174 mc68360 user? manual motorola occur; a zero represents a masked bit position. upon an address match, the address and the data following are written into the data buffers. when the addresses are not matched and the frame is error-free, the nonmatching address received counter (nmarc) is incre- mented. note for 8-bit addresses, mask out (clear) the eight high-order bits in the hmask register. the eight low-order bits of hmask and haddrx should contain the address byte that immediately follows the opening flag. ex- ample: to recognize a frame that begins $7e (flag), $68, $aa, using 16-bit address recognition, haddrx should contain $aa68, and hmask should contain $ffff (see figure 7-51). figure 7-51. hdlc address recognition example rfthr. the received frames threshold value is used to reduce the interrupt overhead that might otherwise occur when a series of short hdlc frames arrives, each causing an rxf interrupt. by setting the rfthr value, the user can limit the frequency of rxf interrupts. the rxf interrupt will only occur when the rfthr value is reached. rfcnt is a down- counter used to implement this feature. note the user should provide enough empty rx bds to receive the number of frames specified in rfthr. 7.10.17.5 hdlc programming model. the cpu32+ core configures each scc to operate in one of the protocols by the mode bits in the gsmr. the hdlc controller uses the same data structure as in all other modes. this data structure supports multibuffer oper- ation and address comparisons. hmask 8-bit address recognition address $68 control $44 flag $7e address $aa etc. 16-bit address recognition $ffff $aa68 $ffff $aa68 $aa68 recognizes one 16-bit address (haddr1) and the 16-bit broadcast address (haddr2). hmask address $55 control $44 flag $7e etc. $00ff $xx55 $xx55 $xx55 $xx55 recognizes a single 8-bit address (haddr1). haddr1 haddr2 haddr3 haddr4 haddr1 haddr2 haddr3 haddr4
serial communication controllers (sccs) motorola mc68360 user? manual 7-175 the receive errors (overrun, nonoctet aligned frame, cd lost, aborted frame, and crc error) are reported through the rx bd. the transmit errors (underrun and cts lost) are reported through the tx bd. 7.10.17.6 hdlc command set. the following transmit and receive commands are issued to the cr. 7.10.17.6.1 transmit commands. the following paragraphs describe the hdlc transmit commands. stop transmit command . after a hardware or software reset and the enabling of the channel in the scc mode register, the channel is in the transmit enable mode and starts polling the first bd in the table every 64 transmit clocks (immediately if the tod bit in the todr is set). the channel stop transmit command disables the transmission of frames on the trans- mit channel. if this command is received by the hdlc controller during frame transmission, transmission is aborted after a maximum of 64 additional bits are transmitted, and the trans- mit fifo is flushed. the tbptr is not advanced, no new bd is accessed, and no new frames are transmitted for this channel. the transmitter will transmit an abort sequence con- sisting of 01111111 (if the command was given during frame transmission) and then begin to transmit flags or idles, as indicated by the hdlc mode register. note if the mff bit in the psmr is set, then it is possible for one or more small frames to be flushed from the transmit fifo. to avoid this, the graceful stop transmit command may be used. graceful stop transmit command . the channel graceful stop transmit command is used to stop transmission in an orderly way rather than abruptly, as performed by the regular stop transmit command. it stops transmission after the current frame has completed transmission, or immediately if there is no frame being transmitted. the gra bit in the scce will be set once transmission has stopped. after transmission ceases, the hdlc transmit parameters, including bds, may be modified. the tbptr will point to the next tx bd in the table. transmission will begin once the r-bit of the next bd is set and the restart transmit command is issued. restart transmit command . the restart transmit command enables the trans- mission of characters on the transmit channel. this command is expected by the hdlc con- troller after a stop transmit command, after a stop transmit command and disabling the channel in its scc mode register, after a graceful stop transmit com- mand, or after a transmitter error (underrun or cts lost when no automatic frame retrans- mission is performed). the hdlc controller will resume transmission from the current tbptr in the channel? tx bd table. init tx parameters command . this command initializes all transmit parameters in this serial channel? parameter ram to their reset state. this command should only be issued
serial communication controllers (sccs) 7-176 mc68360 user? manual motorola when the transmitter is disabled. note that the init tx and rx parameters command may also be used to reset both transmit and receive parameters. 7.10.17.6.2 receive commands. the following paragraphs describe the hdlc receive commands. enter hunt mode command . after a hardware or software reset and the enabling of the channel in the scc mode register, the channel is in the receive enable mode and will use the first bd in the table. the enter hunt mode command is generally used to force the hdlc receiver to abort reception of the current frame and enter the hunt mode. in the hunt mode, the hdlc con- troller continually scans the input data stream for the flag sequence. after receiving the com- mand, the current receive buffer is closed, and the crc is reset. further frame reception will use the next bd. close rx bd command . this command should not be used in the hdlc protocol. init rx parameters command . this command initializes all the receive parameters in this serial channel? parameter ram to their reset state. this command should only be issued when the receiver is disabled. note that the init tx and rx parameters com- mand may also be used to reset both receive and transmit parameters. 7.10.17.7 hdlc error-handling procedure. the hdlc controller reports frame reception and transmission error conditions using the channel bds, the error counters, and the hdlc event register. 7.10.17.7.1 transmission errors. the following paragraphs describe various types of hdlc transmission errors. transmitter underrun . when this error occurs, the channel terminates buffer transmission, closes the buffer, sets the underrun (u) bit in the bd, and generates the txe interrupt if it is enabled. the channel will resume transmission after reception of the restart transmit command. the transmit fifo size is 32 bytes on scc1 and 16 bytes on scc2, scc3, and scc4. cts lost during frame transmission . when this error occurs, the channel terminates buffer transmission, closes the buffer, sets the ct bit in the bd, and generates the txe interrupt if it is enabled. the channel will resume transmission after reception of the restart transmit command. if this error occurs on the first or second buffer of the frame and the rte bit in the hdlc mode register is set, the channel will retransmit the frame when the cts line becomes active again. when working in an hdlc mode with collision possibility, to ensure the retransmis- sion method functions properly, the first and second data buffers should contain more than 36 bytes of data (scc1), and 20 bytes of data (scc2, scc3, and scc4) if multiple buffers per frame are used. (small frames consisting of a single buffer are not subject to this require- ment.) the channel will also increment the retransmission counter.
serial communication controllers (sccs) motorola mc68360 user? manual 7-177 7.10.17.7.2 reception errors. the following paragraphs describe various types of hdlc reception errors. overrun error . the hdlc controller maintains an internal fifo; for receiving data. the cp begins programming the sdma channel (if the data buffer is in external memory) and updat- ing the crc when 8 or 32 bits (according to the rfw bit in the gsmr) are received in the fifo. when a receive fifo overrun occurs, the channel writes the received data byte to the internal fifo over the previously received byte. the previous data byte and the frame status are lost. the channel closes the buffer with the overrun (ov) bit in the bd set and generates the rxf interrupt if it is enabled. the receiver then enters the hunt mode. even if the overrun occurs during a frame whose address is not matched in the address rec- ognition logic, an rx bd with data length two will be opened to report the overrun, and the rxf interrupt will be generated if it is enabled. cd lost during frame reception . when this error occurs, the channel terminates frame reception, closes the buffer, sets the cd bit in the rx bd, and generates the rxf interrupt if it is enabled. this error has the highest priority. the rest of the frame is lost, and other errors are not checked in that frame. the receiver then enters the hunt mode. abort sequence . an abort sequence is detected by the hdlc controller when seven or more consecutive ones are received. when this error occurs and the hdlc controller is currently receiving a frame, the channel closes the buffer by setting the ab bit in the rx bd and gen- erates the rxf interrupt (if enabled). the channel also increments the abort sequence counter. the crc and nonoctet error status conditions are not checked on aborted frames. the receiver then enters hunt mode. if the hdlc controller is not currently receiving a frame when an abort is received, no indi- cation is given to the user. nonoctet aligned frame . when this error occurs, the channel writes the received data to the data buffer, closes the buffer, sets the rx nonoctet aligned frame (no) bit in the rx bd, and generates the rxf interrupt (if enabled). the crc error status should be disregarded on nonoctet frames. after a nonoctet aligned frame is received, the receiver enters hunt mode. (an immediately following back-to-back frame will still be received.) the nonoctet data may be derived from the last word in the data buffer as follows: note if the data buffer swapping option is used (mot bit cleared in the rfcr), then the above diagram refers to the last byte of the data buffer, not the last word. in hdlc, the lsb of each octet is trans- mitted first, and the msb of the crc is transmitted first. msb lsb 10 0 <--------valid data-------> <-------nonvalid data------->
serial communication controllers (sccs) 7-178 mc68360 user? manual motorola crc error . when this error occurs, the channel writes the received crc to the data buffer, closes the buffer, sets the cr bit in the rx bd, and generates the rxf interrupt (if enabled). the channel also increments the crc error counter. after receiving a frame with a crc error, the receiver enters hunt mode. (an immediately following back-to-back frame will still be received.) crc checking cannot be disabled, but the crc error may be ignored if check- ing is not required. 7.10.17.8 hdlc mode register (psmr). each hdlc mode register is a 16-bit, mem- ory-mapped, read-write register that controls scc operation. the term hdlc mode register refers to the psmr of the scc when that scc is configured for hdlc. the hdlc mode register is cleared at reset. nof?umber of flags minimum number of flags between frames or before frames (0 to 15 flags). if nof = 0000, then no flags will be inserted between frames. thus, the closing flag of one frame will be immediately followed by the opening flag of the next frame in the case of back-to-back frames. these bits may be modified on the fly. crc?rc selection 00 = 16-bit ccitt-crc (hdlc). (x16 + x12 + x5 + 1) 01 = reserved. 10 = 32-bit ccitt-crc (ethernet and hdlc). (x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x1 +1) 11 = reserved. rte?etransmit enable 0 = no retransmission 1 = automatic frame retransmission is enabled. this is particularly useful in the hdlc bus protocol and isdn applications where multiple hdlc controllers may be col- liding on a single channel. note that retransmission only occurs if the cts lost hap- pens on the first or second buffer of the frame. bits 8, 2??eserved fse?lag sharing enable this bit is only valid if the rtsm bit is set in gsmr this bit may be modified on the fly. 0 = normal operation 1 = if nof3?of0 = 0000, then a single shared flag is transmitted between back-to- back frames. other values of nof3?of0 are decremented by one when fse is set. this is useful in signaling system #7 applications. 1514131211109876543210 nof crc rte fse drt bus brm mff
serial communication controllers (sccs) motorola mc68360 user? manual 7-179 drt?isable receiver while transmitting 0 = normal operation 1 = while data is being transmitted by the scc, the receiver is disabled, being gated by the internal rts signal. this configuration is useful if the hdlc channel is con- figured onto a multidrop line and the user does not wish to receive his own trans- mission. bus?dlc bus mode 0 = normal hdlc operation 1 = hdlc bus operation selected. see 7.10.18 hdlc bus controller for more details. brm?dlc bus rts mode this bit is only valid if bus = 1; otherwise, it is ignored. 0 = normal rts operation during hdlc bus mode. rts is asserted on the first bit of the transmit frame and negated after the first collision bit is received. 1 = special rts operation during hdlc bus mode. rts is delayed by one bit with re- spect to the normal case. this is useful when the hdlc bus protocol is run locally, and at the same time, transmitted over a long-distance transmission line. data may be delayed by one bit before it is sent over the transmission line; thus, rts may be used to enable the transmission line buffers. the result is a clean signal level sent over the transmission line. mff?ultiple frames in fifo 0 = normal operation. the transmit fifo can never contain more than one hdlc frame. the cts lost status will be reported accurately on a per-frame basis. the receiver is not affected by this bit. 1 = the transmit fifo can contain multiple frames, but cts lost is not guaranteed to be reported on the exact buffer/frame on which it truly occurred. this option, how- ever, can improve the performance of hdlc transmissions in cases of small back- to-back frames or in cases where the user desires to strongly limit the number of flags transmitted between frames. the receiver is not affected by this bit. 7.10.17.9 hdlc receive buffer descriptor (rx bd). the hdlc controller uses the rx bd to report information about the received data for each buffer. an example of the rx bd process is shown in figure 7-52.
serial communication controllers (sccs) 7-180 mc68360 user? manual motorola figure 7-52. hdlc rx bd example mrblr = 8 bytes for this scc buffer 8 bytes time buffer 8 bytes empty buffer 8 bytes empty buffer full e length receive bd 0 status 0008 pointer 0 e length receive bd 1 status 000b pointer 0 1 0 l e length receive bd 2 status 0003 pointer 0 ab 1 e length receive bd 3 status xxxx pointer 1 buffer 8 bytes present time empty buffer still empty abort was received after control byte! buffer closed when closing flag received 1 f 0 lf 1 1 stored in rx buffer stored in rx buffer faaciiiii icrcrf two frames received in hdlc line idle address 1 address 2 control byte last i-field byte crc byte 1 crc byte 2 address 1 address 2 control byte 5 information (i-field) bytes unexpected abort occurs before closing flag! abort/idle faac f = flag a = address byte c = control byte i = information byte legend: cr = crc byte l f 32-bit buffer pointer 32-bit buffer pointer 32-bit buffer pointer 32-bit buffer pointer
serial communication controllers (sccs) motorola mc68360 user? manual 7-181 note: entries in boldface must be initialized by the user. e?mpty 0 = the data buffer associated with this bd has been filled with received data, or data reception has been aborted due to an error condition. the cpu32+ core is free to examine or write to any fields of this rx bd. the cp will not use this bd again while the e-bit remains zero. 1 = the data buffer associated with this bd is empty, or reception is currently in progress. this rx bd and its associated receive buffer are owned by the cp. once the e-bit is set, the cpu32+ core should not write any fields of this rx bd. bits 14, 8, 6?eserved w?rap (final bd in table) 0 = this is not the last buffer descriptor in the rx bd table. 1 = this is the last buffer descriptor in the rx bd table. after this buffer has been used, the cp will receive incoming data into the first bd in the table (the bd pointed to by rbase). the number of rx bd s in this table is programmable, and is deter- mined only by the w-bit and the overall space constraints of the dual-port ram. i?nterrupt 0 = the rxb bit is not set after this buffer has been used, but rxf operation remains unaffected. 1 = the rxb or rxf bit in the hdlc event register will be set when this buffer has been used by the hdlc controller. these two bits may cause interrupts (if en- abled). l?ast in frame this bit is set by the hdlc controller when this buffer is the last in a frame. this implies the reception of a closing flag or reception of an error, in which case one or more of the cd, ov, ab, and lg bits are set. the hdlc controller will write the number of frame oc- tets to the data length field. 0 = this buffer is not the last in a frame. 1 = this buffer is the last in a frame. f?irst in frame this bit is set by the hdlc controller when this buffer is the first in a frame. 0 = the buffer is not the first in a frame. 1 = the buffer is the first in a frame. 1514131211109876543210 offset + 0 e w i l f cm de lg no ab cr ov cd offset + 2 data length offset + 4 rx data buffer pointer offset + 6
serial communication controllers (sccs) 7-182 mc68360 user? manual motorola cm?ontinuous mode 0 = normal operation. 1 = the e-bit is not cleared by the cp after this bd is closed, allowing the associated data buffer to be overwritten automatically when the cp next accesses this bd. however, the e-bit will be cleared if an error occurs during reception, regardless of the cm bit. de?pll error this bit is set by the hdlc controller when a dpll error has occurred during the reception of this buffer. in decoding modes where a transition is promised every bit, the de bit will be set when a missing transition has occurred. lg?x frame length violation a frame length greater than the maximum defined for this channel was recognized (only the maximum-allowed number of bytes (mflr) is written to the data buffer). this event will not be reported until the rx bd is closed and the rxf bit is set, after receipt of the closing flag. the actual number of bytes received between flags is written to the data length field of this bd. no?x nonoctet aligned frame a frame that contained a number of bits not exactly divisible by eight was received. ab?x abort sequence a minimum of seven consecutive ones was received during frame reception. cr?x crc error this frame contains a crc error. the received crc bytes are always written to the re- ceive buffer. ov?verrun a receiver overrun occurred during frame reception. cd?arrier detect lost the carrier detect signal was negated during frame reception. this bit is only valid when working in the nmsi mode. data length data length is the number of octets written by the cp into this bd? data buffer. it is written by the cp once as the bd is closed. when this bd is the last bd in the frame (l = 1), the data length contains the total number of frame octets (including 2 or 4 bytes for crc). the actual amount of memory allocated for this buffer should be greater than or equal to the contents of the mrblr.
serial communication controllers (sccs) motorola mc68360 user? manual 7-183 rx data buffer pointer the receive buffer pointer, which always points to the first location of the associated data buffer, may reside in either internal or external memory. the rx buffer pointer must be divisible by 4. 7.10.17.10 hdlc transmit buffer descriptor (tx bd). data is presented to the hdlc controller for transmission on an scc channel by arranging it in buffers referenced by the channel? tx bd table. the hdlc controller confirms transmission (or indicates error conditions) using the bds to inform the cpu32+ core that the buffers have been serviced. note: entries in boldface must be initialized by the user. r?eady 0 = the data buffer associated with this bd is not ready for transmission. the user is free to manipulate this bd or its associated data buffer. the cp clears this bit after the buffer has been transmitted or after an error condition is encountered. 1 = the data buffer, which has been prepared for transmission by the user, has not been transmitted or is currently being transmitted. no fields of this bd may be writ- ten by the user once this bit is set. bits 14, 8??eserved w?rap (final bd in table) 0 = this is not the last bd in the tx bd table. 1 = this is the last bd in the txbd in the table. after this buffer has been used, the cp will transmit data from the first bd in the table (the bd pointed to by tbase). the number of tx bd s in this table is programmable, and is determined only by the w- bit and the overall space constraints of the dual-port ram. i?nterrupt 0 = no interrupt is generated after this buffer has been serviced. 1 = either txb or txe in the hdlc event register will be set when this buffer has been serviced by the hdlc controller. these bits can cause interrupts (if enabled). l?ast 0 = this is not the last buffer in the frame. 1 = this is the last buffer in the current frame. 1514131211109876543210 offset + 0 r wi ltccm unct offset + 2 data length offset + 4 tx data buffer pointer offset + 6
serial communication controllers (sccs) 7-184 mc68360 user? manual motorola tc?x crc this bit is valid only when the l-bit is set; otherwise, it is ignored. 0 = transmit the closing flag after the last data byte. this setting can be used for test- ing purposes to send a bad crc after the data. 1 = transmit the crc sequence after the last data byte. cm?ontinuous mode 0 = normal operation. 1 = the r-bit is not cleared by the cp after this bd is closed, allowing the associated data buffer to be retransmitted automatically when the cp next accesses this bd. however, the r-bit will be cleared if an error occurs during transmission, regard- less of the cm bit. the following status bits are written by the hdlc controller after it has finished transmitting the associated data buffer. un?nderrun the hdlc controller encountered a transmitter underrun condition while transmitting the associated data buffer. ct?ts lost cts in nmsi mode or layer 1 grant was lost in gci mode during frame transmission. if data from more than one buffer is currently in the fifo when this error occurs, this bit will be set in the tx bd that is currently open. data length the data length is the number of bytes the hdlc controller should transmit from this bd? data buffer. it is never modified by the cp. the value of this field should be greater than zero. tx data buffer pointer the transmit buffer pointer, which contains the address of the associated data buffer, may be even or odd. the buffer may reside in either internal or external memory. this value is never modified by the cp. 7.10.17.11 hdlc event register (scce). the scce is called the hdlc event regis- ter when the scc is operating as an hdlc controller. it is a 16-bit register used to report events recognized by the hdlc channel and to generate interrupts. on recognition of an event, the hdlc controller will set the corresponding bit in the hdlc event register. inter- rupts generated by this register may be masked in the hdlc mask register. an example of interrupts that may be generated in the hdlc protocol is shown in figure 7-53.
serial communication controllers (sccs) motorola mc68360 user? manual 7-185 figure 7-53. hdlc interrupt event example the hdlc event register is a memory-mapped register that may be read at any time. a bit is cleared by writing a one (writing a zero does not affect a bit? value). more than one bit may be cleared at a time. all unmasked bits must be cleared before the cp will clear the internal interrupt request. this register is cleared at reset. bits 15?3, 6, 5?eserved these bits should be written with zeros. glr?litch on rx a clock glitch was detected by this scc on the receive clock. 1514131211109876543210 glr glt dcc flg idl gra txe rxf bsy txb rxb line idle stored in rx buffer frame received in hdlc time rxd cd line idle line idle stored in tx buffer cts line idle txd rts idl cd cd rxb cts cts txb notes: 1. rxb event assumes receive buffers are 6 bytes each. 2. the second idl event occurs after 15 ones are received in a row. 3. the flg interrupts show the beginning and end of flag reception. 4. the flg interrupt at the end of the frame may precede the rxf interrupt due to receive fifo latency. 5. the cd event must be programmed in the port c parallel i/o, not in the scc itself. 6. f = flag, a = address byte, c = control byte, i = information byte, and cr = crc byte. notes: 1. txb event shown assumes all three bytes were put into a single buffer. 2. example shows one additional opening flag. this is programmable. 3. the cts event must be programmed in the port c parallel i/o, not in the scc itself. hdlc scce events hdlc scce events frame transmitted by hdlc f a a c i cr cr i if rxf flg idl f a a c cr cr f f flg flg f flg
serial communication controllers (sccs) 7-186 mc68360 user? manual motorola glt?litch on tx a clock glitch was detected by this scc on the transmit clock. dcc?pll cs changed the carrier sense status as generated by the dpll has changed state. the real-time sta- tus may be found in sccs. this is not the cd pin status (which is reported in port c), and is only valid when the dpll is used. flg?lag status the hdlc controller has stopped or started receiving hdlc flags. the real-time status may be obtained in sccs. idl?dle sequence status changed a change in the status of the serial line was detected on the hdlc line. the real-time sta- tus of the line may be read in sccs. gra?raceful stop complete a graceful stop, which was initiated by the graceful stop transmit command, is now complete. this bit is set as soon the transmitter has finished transmitting any frame that was in progress when the command was issued. it will be set immediately if no frame was in progress when the command was issued. txe?x error an error (cts lost or underrun) occurred on the transmitter channel. rxf?x frame a complete frame has been received on the hdlc channel. this bit is set no sooner than two clocks after receipt of the last bit of the closing flag. bsy?usy condition a frame was received and discarded due to lack of buffers. txb?ransmit buffer a buffer has been transmitted on the hdlc channel. this bit is set no sooner than when the last bit of the closing flag begins its transmission if the buffer is the last one in the frame. otherwise, this bit is set after the last byte of the buffer has been written to the transmit fifo. rxb?eceive buffer a buffer has been received on the hdlc channel that was not a complete frame. 7.10.17.12 hdlc mask register (sccm). the sccm is referred to as the hdlc mask register when the scc is operating as an hdlc controller. it is a 16-bit read-write register with the same bit formats as the hdlc event register. if a bit in the hdlc mask register is a one, the corresponding interrupt in the event register will be enabled. if the bit is zero, the corresponding interrupt in the event register will be masked. this register is cleared upon reset.
serial communication controllers (sccs) motorola mc68360 user? manual 7-187 7.10.17.13 scc status register (sccs). the sccs is an 8-bit read-only register that allows the user to monitor real-time status conditions on the rxd line. the real-time status of the cts and cd pins are part of the port c parallel i/o. bits 7??eserved fg?lags while fg is cleared, the most recently received 8 bits are examined every bit time to see if a flag is present. fg is set as soon as an hdlc flag ($7e) is received on the line. once fg is set, it will remain set at least 8 bit times, at which time the next 8 received bits are examined. if another flag occurs, then fg remains set for at least another eight bits; oth- erwise, fg is cleared and the search begins again. the examination of the line is made after the data has been decoded by the dpll. 0 = hdlc flags are not currently being received. 1 = hdlc flags are currently being received. cs?arrier sense (dpll) this bit shows the real-time carrier sense of the line as determined by the dpll, if it is used. 0 = the dpll does not sense a carrier. 1 = the dpll does sense a carrier. id?dle status id is set when the rxd pin is a logic one for 15 or more consecutive bit times; it is cleared after a single logic zero is received. 0 = the line is not currently idle. 1 = the line is currently idle. 7.10.17.14 scc hdlc example #1. the following list is an initialization sequence for an scc hdlc channel assuming an external clock is provided. scc4 is used. the hdlc con- troller is configured with the rts4 , cts4 , and cd4 pins active. the clk7 pin is used for both the hdlc receiver and transmitter. 1. the sdcr (sdma configuration register) should be initialized to $0740, rather than being left at its default value of $0000. 2. configure the port a pins to enable the txd4 and rxd4 pins. write papar bits 6 and 7 with ones. write padir bits 6 and 7 with zeros. write paodr bits 6 and 7 with zeros. 3. configure the port c pins to enable rts4 , cts4 , and cd4 . write pcpar bit 3 with one, and bits 10 and 11 with zeros. write pcdir bits 3, 10 and 11 with zeros. write pcso bits 10 and 11 with ones. 4. configure port a to enable the clk7 pin. write papar bit 14 with a one. write padir bit 14 with a zero. 76543210 fgcsid
serial communication controllers (sccs) 7-188 mc68360 user? manual motorola 5. connect the clk7 pin to scc4 using the si. write the r4cs bits in sicr to 110. write the t4cs bits in sicr to 110. 6. connect the scc4 to the nmsi (i.e., its own set of pins). clear the sc4 bit in the sicr. 7. write $0740 to the sdcr to initialize the sdma configuration register. 8. write rbase and tbase in the scc parameter ram to point to the rx bd and tx bds in the dual-port ram. assuming one rx bd at the beginning of dual-port ram and one tx bd following that rx bd, write rbase with $0000 and tbase with $0008. 9. program the cr to execute the init rx & tx params command for this channel." for instance, to execute this command for scc1, write $0001 to the cr. this com- mand causes the rbptr and tbptr parameters of the serial channel to be updated with the new values just programmed into rbase and tbase. 10. write rfcr with $18 and tfcr with $18 for normal operation. 11. write mrblr with the maximum number of bytes per receive buffer. for this case, assume 256 bytes, so mrblr = $0100. the value 256 was chosen to allow an entire receive frame to fit into one receive buffer (see mflr below). 12. write c_mask with $0000f0b8 to comply with 16-bit ccitt-crc. 13. write c_pres with $0000ffff to comply with 16-bit ccitt-crc. 14. clear disfc, crcec, abtsc, nmarc, and retrc for the sake of clarity. 15. write mflr with $0100 to make the maximum frame size 256 bytes. 16. write rfthr with $0001 to allow interrupts after each frame. 17. write hmask with $0000 to allow all addresses to be recognized. 18. clear haddr1, haddr2, haddr3, and haddr4 for clarity. 19. initialize the rx bd. assume the rx data buffer is at $00001000 in main memory. write $b000 to rx_bd_status. write $0000 to rx_bd_length (not required?one for instructional purposes only). write $00001000 to rx_bd_pointer. 20. initialize the tx bd. assume the tx data frame is at $00002000 in main memory and contains five 8-bit characters. write $bc00 to tx_bd_status. write $0005 to tx_bd_length. write $00002000 to tx_bd_pointer. 21. write $ffff to the scce to clear any previous events. 22. write $001a to the sccm to enable the txe, rxf, and txb interrupts. 23. write $08000000 to the cimr to allow scc4 to generate a system interrupt. (the cicr should also be initialized.) 24. write $00000000 to gsmr_h4 to enable normal behavior of the cts and cd pins and idles between frames (as opposed to flags). 25. write $00000000 to gsmr_l4 to configure the cts and cd pins to automatically control transmission and reception (diag bits) and the hdlc mode. normal operation of the transmit clock is used (tci is cleared). notice that the transmitter (ent) and receiver (enr) have not been enabled. if inverted hdlc operation
serial communication controllers (sccs) motorola mc68360 user? manual 7-189 is desired, set the rinv and tinv bits. 26. set the psmr4 to $0000 to configure one opening and one closing flag, 16-bit ccitt-crc, and prevention of multiple frames in the fifo. 27. write $00000030 to gsmr_l4 to enable the scc4 transmitter and receiver. this additional write ensures that the ent and enr bits will be enabled last. note after 5 bytes and crc have been transmitted, the tx bd is closed. additionally, the receive buffer is closed after a frame is received. any additional receive data beyond 256 bytes or a sin- gle frame will cause a busy (out-of-buffers) condition since only one rx bd was prepared. 7.10.17.15 scc hdlc example #2. ?he following is an initialization sequence for an scc hdlc channel that uses the dpll in a manchester encoding. the user provides a clock that is 16x the desired bit rate, on the clk7 pin. clk7 is then connected to the hdlc transmitter and receiver. (a baud rate generator could have been used instead, if desired). scc4 is used. the hdlc controller is configured with the rts4 , cts4 , and cd4 pins active. 1. follow all the steps in the hdlc example #1, until the step where the gsmr is initial- ized. 2. write $00000000 to gsmr_h4 to enable normal behavior of the cts and cd pins, and idles between frames (as opposed to flags). 3. write $004aa400 to gsmr_l4 to configure carrier sense always active, a 16-bit pre- amble of "01" pattern, 16x operation of the dpll for the receiver and transmitter, manchester encoding for the receiver and transmitter, the cts and cd pins to auto- matically control transmission and reception (diag bits), and the hdlc mode. notice that the transmitter (ent) and receiver (enr) have not been enabled yet. 4. set the psmr4 to $0000 to configure one opening and one closing flag, 16-bit ccitt- crc, and not allowing multiple frames in the fifo. 5. write $004aa430 to gsmr_l4 to enable the scc4 transmitter and receiver. this ad- ditional write ensures that the ent and enr bits will be enabled last. note after the preamble and 5 bytes have been transmitted, the tx bd is closed. additionally, the receive buffer is closed after 16 bytes have been received. any additional receive data beyond 16 bytes will cause a busy (out-of-buffers) condition since only one rx bd was prepared. 7.10.18 hdlc bus controller hdlc bus is an enhancement of hdlc that allows an hdlc-based lan and other hdlc point-to-multipoint configurations to be easily implemented. most versions of hdlc-based controllers only provide point-to-point communications.
serial communication controllers (sccs) 7-190 mc68360 user? manual motorola hdlc bus is based on the techniques used in the ccitt isdn i.430, and ansi t1.605 stan- dards for d-channel point-to-multipoint operation over the s/t interface. however, hdlc bus is not fully compliant with i.430 or t1.605, and cannot be used to directly replace devices that implement these protocols. instead, hdlc bus is more suited to the needs of non-isdn lan and point-to-multipoint configurations. it may be helpful for the reader to review the basic features of i.430 and t1.605 before learn- ing hdlc bus. i.430/t1.605 define a method whereby 8 terminals may be connected over the d-channel of the s/t bus of isdn. the protocol used at layer 2 is a variant of hdlc, called lapd. how- ever, at layer 1, a method is provided to allow any of the 8 terminals to acquire access to the physical s/t bus to send frames to the switch. the s/t interface device detects whether the channel is clear by looking at an "echo" bit on the line. the echo bit is designed to echo whatever bit was most recently transmitted on the d channel. depending on the "class" of the terminal, and the particular situation, the s/t interface device may wait for 7, 8, 9, or 10 ones on the echo bit before allowing the lapd frame to begin transmission. once transmission begins, the s/t chip monitors the data that was sent. as long as the echo bit matches the transmit data, the transmission continues. if the echo bit is ever a zero when the transmit bit is a one, then a collision has occurred between terminals, and the station(s) that transmitted a zero immediately stops further transmission. the station that transmitted a one continues normally. in summary, i.430/t1.605 provides a physical layer protocol that allows multiple terminals to share the same physical connection. these protocols make very efficient use of the bus by dealing with collisions in such a way that one station is always able to complete its trans- mission. once a station completes a transmission, it lowers its own priority to give other devices fair access to the physical connection. hdlc bus works much the same way; however, a few differences exist. first, hdlc bus does not use the echo bit, but rather a separate pin (cts ) to monitor the data that was trans- mitted. the transmit data is simply connected to the cts input. second, hdlc bus is a syn- chronous digital open-drain connection for short-distance configurations, rather than the more complex definition of the s/t interface. third, hdlc bus allows any hdlc-based frame protocol to be implemented at layer 2, not just lapd. fourth, hdlc bus devices wait either 8 or 10 bit times before transmitting, rather than 7, 8, 9, or 10 bits (hdlc bus has one "class" rather than two). figure 7-54 shows hdlc-bus in its most common lan configuration. all stations may trans- mit and receive data to/from every other station on the lan. all transmissions are half- duplex, as is typical in lans.
serial communication controllers (sccs) motorola mc68360 user? manual 7-191 figure 7-54. hdlc bus multi-master configuration figure 7-55 shows the other lan-type configuration of hdlc bus. in this configuration, a master station transmits to any slave station, with no collisions possible. the slaves com- municate only with the master, but may experience collisions in their access over the bus. in this configuration, a slave that must communicate with another slave must first transmit its data to the master, where the data is buffered in ram and then retransmitted to the other slave. the benefit of this configuration, however, is that full-duplex operation may be obtained. this configuration is preferred in a point-to-multipoint environment. figure 7-55. hdlc bus single-master configuration hdlc-bus controller hdlc-bus lan a hdlc-bus controller b hdlc-bus controller c master master master r +5 notes: 1. transceivers may be used to extend the lan size, if necessary. 2. the txd pins should be configured to open-drain in the port c parallel i/o port. txd rxd cts txd rxd cts txd rxd cts hdlc controller hdlc-bus lan a hdlc bus controller b hdlc bus controller c master slave slave r +5 notes: 1. transceivers may be used to extend the lan size, if necessary. 2. the txd pins of slave devices should be configured to open-drain in the port c parallel i/o port. txd rxd cts txd rxd cts txd rxd
serial communication controllers (sccs) 7-192 mc68360 user? manual motorola 7.10.18.1 hdlc bus key features. the hdlc bus controller contains the following key features: superset of the hdlc controller features automatic hdlc bus access automatic retransmission in case of a collision may be used with the nmsi mode or a tdm bus delayed rts mode 7.10.18.2 hdlc bus operation. the following paragraphs detail the operation of the hdlc bus controller. 7.10.18.2.1 accessing the hdlc bus. hdlc bus ensures an orderly access to the bus when two or more transmitters attempt to access the bus simultaneously. in such a case, one transmitter will always be successful in completing its transmission. this procedure relies upon the use of hdlc flags consisting of the binary pattern 01111110 ($7e) and the use of the zero bit insertion to prevent flag imitation. while in the active condition (desiring to transmit), the hdlc bus controller will monitor the bus through the cts pin. it counts the number of one bits using the cts pin, and if a zero is detected, the internal counter is cleared. once 8 consecutive ones have been received, the hdlc bus controller will begin transmis- sion on the line. while it is transmitting information on the bus, the transmitted data is con- tinuously compared with the data actually on the bus. the cts pin is used to sample the external bus. figure 7-56 shows how the cts pin is used. the cts sample is taken halfway through the bit time, using the rising edge of the transmit clock. if the transmitted bit is the same as the received cts sample, the hdlc bus controller continues its transmission. if, however, the received cts bit is zero, but the transmitted bit was 1, the hdlc controller ceases trans- mission following that bit and returns to the active condition. since the hdlc bus uses a wired-or scheme, a transmitted zero has priority over a transmitted one. if the source address is included in the hdlc frame in addition to the destination address, a predefined priority of nodes will result. in addition, the inclusion of a source address will allow collisions to be detected no later than the end of the source address. note hdlc bus can be used with many different hdlc-based frame formats. hdlc bus does not specify the type of hdlc protocol used.
serial communication controllers (sccs) motorola mc68360 user? manual 7-193 figure 7-56. hdlc bus collision detection to ensure that all stations gain an equal share of the bus, a priority mechanism is also imple- mented in hdlc bus. once an hdlc bus node has completed the transmission of a frame, it waits for 10 consecutive one bits, rather than just 8, before beginning the next transmis- sion. in this way, all nodes desiring to transmit will obtain the bus, before a node transmits twice. once a node detects that 10 consecutive ones have occurred on the bus, it may attempt transmission and can reinstate its original priority of waiting for 8 ones. 7.10.18.2.2 more performance. since hdlc bus is used in a wired-or configuration, the limit of hdlc bus operation is determined by the rise time of the one bit. figure 7-57 shows a method to increase performance. the user supplies a clock that is high for a shorter duration than it is low, which allows more rise time in the case of a one bit. figure 7-57. non-symmetrical duty cycle txd (output) tclk cts (input) cts sampled at halfway point. collision detected when txd = 1, but cts = 0. txd (output) tclk cts sampled at three quarter point . collision detected when txd = 1, but cts = 0. cts (input)
serial communication controllers (sccs) 7-194 mc68360 user? manual motorola 7.10.18.2.3 delayed rts mode. sometimes hdlc bus may be used in a configuration having a local hdlc bus and a standard transmission line that is not an hdlc bus. figure 7-58 illustrates such a case. the local hdlc bus controllers do not communicate with each other, but with a station on the transmission line; yet the hdlc bus protocol is used to con- trol the access to the transmission line. in such a case, the rts pin may be used as follows. figure 7-58. hdlc bus transmission line configuration normally, the rts pin goes active at the beginning of the first bit of the opening flag. use of rts is not normally required in hdlc bus; however, a mode exists on the quicc? hdlc bus that delays the rts signal by one bit with respect to the data. this mode is selected with the brm bit in the psmr. the delayed rts mode is useful when the hdlc bus is used to connect multiple local nodes to a transmission line. if the transmission line driver has a one-bit delay, then the delayed rts line can be used to enable the output of the transmission line driver. the result is that the transmission line bits always drive "clean" without any collisions occurring on them. the rts timing is shown in figure 7-59. local hdlc bus hdlc bus controller a hdlc bus controller b notes: 1. the txd pins of slave devices should be configured to open-drain in the port c parallel i/o port. 2. the rts pins of each hdlc bus controller are configured to delayed rts mode. line driver rx tx rts rts en r +5 txd rxd cts txd rxd cts (1-bit delay)
serial communication controllers (sccs) motorola mc68360 user? manual 7-195 figure 7-59. delayed rts mode 7.10.18.2.4 using the tsa. sometimes hdlc bus may be used in a configuration that has a local hdlc bus, and a tdm transmission line that is not an hdlc bus. figure 7-60 shows such a case. the local hdlc bus controllers all communicate over time slots; however, more than one hdlc bus controller is assigned to a given time slot, and the hdlc bus pro- tocol is used to control access during that time slot. figure 7-60. hdlc bus tsa transmission line configuration once again, the local hdlc controllers do not communicate with each other, only with the transmission line. if the scc is configured to operate using the tsa of the si, then the data will be received and transmitted using the l1txdx and l1rxdx pins. the collision sensing tclk txd cts rts collision 1st bit 2nd bit 3rd bit rts active for only 2 bit times hdlc bus controller l1txd l1rxd a notes: 1. all tx pins of slave devices should be configured to open-drain in the port c parallel i/o port. 2. the tsa in the si of each station is used to configure the desired time slot. 3. the choice of the number of stations to share a time slot is user-defined. it is two in this example. rx tx local hdlc bus stations share time slot n stations share time slot m r +5 cts hdlc bus controller l1txd l1rxd b cts hdlc bus controller l1txd l1rxd c cts hdlc bus controller l1txd l1rxd d cts line driver
serial communication controllers (sccs) 7-196 mc68360 user? manual motorola is still obtained from the scc? individual ctsx pin; thus, the cts pin must be configured in port c to connect to the desired scc. since the scc only receives clocks during its time slot, the cts pin is only sampled during the transmit clock edges of the scc? particular time slot. 7.10.18.3 hdlc bus memory map and programming. hdlc bus on the quicc is implemented using the hdlc controller with certain bits set. otherwise, the user should con- sult the hdlc controller section for detailed information on the programming of hdlc. 7.10.18.3.1 gsmr programming. the gsmr programming sequence is as follows: 1. set the mode bits to hdlc. 2. set the ent and enr bits as desired. 3. set the diag bits for normal operation. 4. set the rdcr and tdcr bits for 1x clock. 5. set the tenc and renc bits for nrz. 6. clear rtsm. 7. set ctss to one and all other bits to zero or to their default condition. 7.10.18.3.2 psmr programming. the psmr programming sequence is as follows: 1. set the nof bits as desired. 2. set the crc to 16-bit crc ccitt. 3. set the rte bit. 4. set the bus bit. 5. set the brm bit to one or zero as desired. 6. set all other bits to zero or to their default condition. 7.10.18.3.3 hdlc bus controller example. except for the previously discussed register programming, the hdlc example #1 may be followed. 7.10.19 appletalk controller appletalk is a set of protocols developed by apple computer inc. to provide a lan service between macintosh computers and printers. although appletalk can be implemented over a variety of physical and link layers, including ethernet, the appletalk protocols have tradi- tionally been most closely associated with one particular physical and link layer protocol called localtalk. the term localtalk refers to an hdlc-based link layer and physical layer protocol that runs at the rate of 230.4 kbps. in this document, the term appletalk controller refers to a support that the quicc provides for the localtalk protocol. the appletalk controller provides the required frame synchronization, bit sequence, pream- ble, and postamble onto standard hdlc frames. these capabilities, as well as the use of the hdlc controller in conjunction with the dpll operating in fm0 mode, provide the proper connection formats to the localtalk bus.
serial communication controllers (sccs) motorola mc68360 user? manual 7-197 note the mc68302 also provides the same general level of localtalk functionality when it is combined with its companion chip, the mc68195 localtalk adaptor (la). the la device, however, is not required with the quicc. 7.10.19.1 localtalk bus operation. the following paragraphs detail the operation of the localtalk. a localtalk frame is a modified hdlc frame as shown in figure 7-61. figure 7-61. localtalk frame format first, a synchronization sequence of greater than three bits is sent. this sequence consists of at least one logical one bit, fm0 encoded, followed by greater than two bit times of line idle. no particular maximum time is specified for this line idle time. the idle time allows some localtalk equipment to sense carrier by detecting a "missing clock" on the line. the remainder of the frame is a typical half-duplex hdlc frame. two or more flags are sent, allowing bit, byte, and frame delineation/detection. two bytes of address, destination and source, are transmitted next. this is followed by a byte of control and 0 to 600 data bytes. next, two bytes of crc are sent. the crc is the common 16-bit crc-ccitt polynomial referenced in the hdlc standard protocol. the localtalk frame is then terminated by a flag and a restricted hdlc abort sequence (a sequence of 12 to 18 logical ones). the transmit- ter's driver is then disabled. the control byte within the localtalk frame indicates the type of frame. control byte values from 0x01 to 0x7f are data frames, and control byte values from 0x80 to 0xff are control frames. four different control frames are currently defined: enq (enquiry), ack (enq acknowledgement), rts (request to send a data frame), and cts (clear to send a data frame). frames are sent in groups known as dialogs. for instance, to transfer a data frame, three frames are actually sent over the network: an rts frame (not to be confused with the rs- 232 pin rts) is sent requesting the network, a cts frame is sent by the destination node, and the data frame is sent by the requesting node. these three frames comprise one pos- sible type of dialog. once a dialog has begun, other nodes cannot begin transmission until the dialog is complete. dialogs are typically handled in software. frames within a dialog are transmitted with a maximum interframe gap (ifg) of 200 m s. although the localtalk specification does not state it, there is also a minimum recom- mended ifg of 50 m s. dialogs must be separated by a minimum interdialog gap (idg) of 400 m s. in general, these gaps are implemented via software. sync seq abort sequence hdlc flags closing flag crc-16 dest. addr. source addr. control byte data (optional) > 3 bits 2 or more bytes 1 byte 1 byte 1 byte 0?00 bytes 2 bytes 1 byte 12?8 ones
serial communication controllers (sccs) 7-198 mc68360 user? manual motorola due to the protocol definition, collisions should only be encountered during rts and enq frames. once a frame's transmission is started, it is fully transmitted, regardless of whether it collides with another frame. enq frames are infrequent, being sent only when a node is powered up and enters the network. a higher level protocol controls the uniqueness and transmission of enq frames. in addition to the frame fields, localtalk requires that the frame be fm0 (differential manchester space) encoded. fm0 requires one level transition on every bit boundary. if the value to be encoded is a logic zero, fm0 also requires a second transition in the middle of the bit time. the purpose of the fm0 encoding is to eliminate the need to transmit clocking information on a separate wire. with fm0, the clocking information is present whenever valid data is present. 7.10.19.2 appletalk controller key features. the appletalk controller con- tains the following key features: superset of the hdlc controller features provides fm0 encoding/decoding programmable transmission of sync sequence automatic postamble transmission reception of sync sequence does not cause extra cd interrupts reception automatically disabled while transmitting a frame transmit-on-demand feature expedites frames connects directly to rs-422 transceiver 7.10.19.3 quicc appletalk hardware connection. the quicc connects to localtalk as shown in figure 7-62. the quicc interfaces to the rs-422 transceiver through the txd, rts, and rxd pins. the rs-422, in turn, interfaces to the localtalk connector. although it is not shown, a passive rc circuit is recommended between the transceiver and the connector. the 16x overspeed clock of 3.686 mhz may be generated from an external frequency source or from one of the baud rate generators if the resulting brg output frequency is close to a multiple of the 3.686-mhz frequency (within the tolerance specified by localtalk). the quicc asserts the rts signal for the complete duration of the frame; thus, rts may be used to enable the rs-422 transmit driver. 7.10.19.4 appletalk memory map and programming model. the appletalk controller on the quicc is implemented using the hdlc controller with certain bits set. oth- erwise, the user should consult 7.10.18 hdlc bus controller for detailed information on the programming of hdlc.
serial communication controllers (sccs) motorola mc68360 user? manual 7-199 figure 7-62. connecting the quicc to localtalk 7.10.19.4.1 gsmr programming. the gsmr programming sequence is as follows: 1. the mode bits should be set to appletalk. 2. the ent and enr bits should be set. 3. the dig bits should be set for normal operation, with the cd and cts pins grounded or with the cd and cts pins configured for parallel i/o, which causes cd and cts to be internally asserted to the scc. 4. the rdcr and tdcr bits should usually be set to 16x clock. 5. the tenc and renc bits should be set for fm0. 6. the tend bit should be zero. 7. the tpp bits should be 11. 8. the tpl bits should be set to 000 to transmit the next frame with no synchronization sequence and to 001 to transmit the next frame with the localtalk synchronization sequence. for example, data frames do not require a preceding synchronization sequence. these bits may be modified on the fly if the appletalk protocol is selected. 9. the tinv and rinv bits should be zero. 10. the tsnc bits should be set to 1.5 bit times 10. 11. the edge bits should be zero. 12. rtsm should be zero. 13. all other bits should be set to zero or to their default condition. quicc rs-422 mini-din 8 scc txd rts rxd tx data rx data tx enable 16 ones (abort) crc-16 stored in transmit buffer stored in receive buffer rts txd dest. addr. source addr. control byte data standard hdlc frame handling 6-bit sync seq two hdlc flags closing flag
serial communication controllers (sccs) 7-200 mc68360 user? manual motorola 7.10.19.4.2 psmr programming. the psmr programming sequence is as follows: 1. the nof bits should be set to 0001 (binary) giving two flags before frames (one open- ing flag, plus one additional flag). 2. the crc should be set to 16-bit crc-ccitt. 3. the drt bit should be set. 4. all other bits should be set to zero or to their default condition. 7.10.19.4.3 todr programming. to expedite a transmit frame, the transmit on demand register (todr) may be used. 7.10.19.4.4 appletalk controller example. except for the previously discussed register programming, the hdlc example #1 may be followed. 7.10.20 bisync controller the byte-oriented binary synchronous communication (bisync) protocol was originated by ibm for use in networking products. the three classes of bisync frames are transparent, non-transparent with header, and non-transparent without header (see figure 7-63). the transparent mode in bisync allows full binary data to be transmitted with any possible char- acter pattern. each class of frame starts with a standard two-octet synchronization pattern and ends with a block check code (bcc). the end of text character (etx) is used to sepa- rate the text and bcc fields. note the transparent frame type in bisync is not related to the total- ly transparent protocol supported by the quicc. see 7.10.21 transparent controller for details. figure 7-63. typical bisync frames the bulk of the frame is divided into fields whose meaning depends on the frame type. the bcc is a 16-bit crc (crc16) format if 8-bit characters are used; it is a longitudinal check (a sum check) in combination with vertical redundancy check (parity) if 7-bit characters are used. in transparent operation, to allow the bisync control characters to be present in the frame as valid text data, a special character (dle) is defined, which informs the receiver that the character following the dle is a text character, not a control character. if a dle is trans- mitted as valid data, it must be preceded by a dle character. this technique is sometimes called byte-stuffing. non-transparent with header syn1 syn2 soh header stx text etx bcc non-transparent without header syn1 syn2 stx text etx bcc transparent syn1 syn2 dle stx transparent text dle etx bcc
serial communication controllers (sccs) motorola mc68360 user? manual 7-201 the physical layer of the bisync communications link must provide a means of synchro- nizing the receiver and transmitter. this is usually accomplished by sending at least one pair of synchronization characters prior to every frame bisync is unusual in that a transmit underrun need not be an error. if an underrun occurs, the synchronization pattern is transmitted until data is once again ready to transmit. the receiver discards the additional synchronization characters as they are received. in non- transparent operation, all synchronization characters (syncs) are discarded. in transparent operation, all dle-sync pairs are discarded. (correct operation in this case assumes that, on the transmit side, the underrun does not occur between the dle and its following char- acter, a failure mode that is prevented in the quicc.) by appropriately setting the scc mode register, any of the scc channels may be config- ured to function as a bisync controller. the bisync controller handles the basic functions of the bisync protocol in normal mode and in transparent mode. the scc in bisync mode can work with the tsa or nmsi. the scc can support modem lines by a connection to the port c pins or by using the general-purpose i/o pins. the bisync controller consists of separate transmit and receive sections whose operations are asynchronous with the cpu32+ core and may be either synchronous or asynchronous with respect to the other sccs. 7.10.20.1 bisync controller features. the bisync controller contains the fol- lowing key features: flexible data buffers eight control character recognition registers automatic sync1?ync2 detection 16-bit pattern (bisync) 8-bit pattern (monosync) 4-bit pattern (nibblesync) external sync pin support sync/dle stripping and insertion crc16 and lrc generation/checking parity (vrc) generation/checking supports bisync transparent operation (use of dle characters) maintains parity error counter reverse data mode 7.10.20.2 bisync channel frame transmission. the bisync transmitter is designed to work with almost no intervention from the cpu32+ core. when this cpu32+ core enables the bisync transmitter, it will start transmitting syn1?yn2 pairs (located in the data synchronization register) or idle as programmed in the bisync mode register. the bisync controller polls the first bd in the transmit channel? bd table. if there is a message
serial communication controllers (sccs) 7-202 mc68360 user? manual motorola to transmit, the bisync controller will fetch the data from memory and start transmitting the message (after first transmitting the syn1?yn2 pair). the entire syn1?yn2 pair is always transmitted, regardless of the programming of the synl bits in the gsmr. when a bd? data has been completely transmitted, l-bit is checked. if both the l-bit, and transmit bcs bit are set in that bd, the bisync controller will append the crc16/lrc. sub- sequently, the bisync controller writes the message status bits into the bd and clears the r-bit. it will then start transmitting syn1?yn2 pairs or idles as programmed in the rtsm bit in the gsmr. when the end of the current bd has been reached and the last bit is not set (working in multibuffer mode), only the r-bit is cleared. in both cases, an interrupt is issued according to the i-bit in the bd. by appropriately setting the i-bit in each bd, inter- rupts can be generated after the transmission of each buffer, a specific buffer, or each block. the bisync controller will then proceed to the next bd in the table. if no additional buffers have been presented to the bisync controller for transmission, an in-frame underrun is detected, and the bisync controller begins transmitting either syncs or idles. if the bisync controller was in transparent mode, the bisync controller transmits dle-sync pairs. characters are included in the block check sequence (bcs) calculation on a per-buffer basis. each buffer can be independently programmed to be included or excluded from the bcs calculation, and any characters to be excluded from the bcs calculation must reside in a separate buffer. the bisync controller can reset the bcs generator before transmitting a specific buffer. when functioning in transparent mode, the bisync controller automati- cally inserts a dle before transmitting a dle character. in this case, only one dle is used in the calculation of the bcs. 7.10.20.3 bisync channel frame reception. although the bisync receiver is designed to work with almost no intervention from the cpu32+ core, it allows user interven- tion on a per-byte basis if necessary. the bisync receiver can perform crc16, longitudinal redundancy check (lrc), or vertical redundancy check (vrc) checking, sync stripping in normal mode, dle-sync stripping and stripping of the first dle in dle-dle pairs in trans- parent mode, and control character recognition. a control character is discussed in 7.10.20.6 bisync control character recognition. when the cpu32+ core enables the bisync receiver, it will enter hunt mode. in this mode, as data is shifted into the receiver shift register one bit at a time, the contents of the register are compared to the contents of the syn1?yn2 fields in the data synchronization register. if the two are not equal, the next bit is shifted in, and the comparison is repeated. when the registers match, the hunt mode is terminated, and character assembly begins. the bisync controller is now character synchronized and will perform sync stripping and message reception. the bisync controller will revert to the hunt mode when it is issued the enter hunt mode command, upon recognition of some error condition, or upon reception of an appropriately defined control character. when receiving data, the bisync controller updates the bcs bit (cr) in the bd for every byte transferred. when the data buffer has been filled, the bisync controller clears the e- bit in the bd and generates an interrupt if the i-bit in the bd is set. if the incoming data
serial communication controllers (sccs) motorola mc68360 user? manual 7-203 exceeds the length of the data buffer, the bisync controller will fetch the next bd in the table and, if it is empty, will continue to transfer data to this bd? associated data buffer. when a bcs is received, it is checked and written to the data buffer. the bisync controller sets the last bit, writes the message status bits into the bd, and clears the e-bit. then it gen- erates a maskable interrupt, indicating that a block of data has been received and is in mem- ory. note that the syncs in the non-transparent mode or dle-sync pairs in the transparent mode (i.e., an underrun condition) are not included in the bcs calculations. note the receive fifo width (rfw) bit in the gsmr must be set for an 8-bit receive fifo for the bisync receiver. 7.10.20.4 bisync memory map. when configured to operate in bisync mode, the quicc overlays the structure listed in table 7-5 with the bisync-specific parameters described in table 7-9. note: boldfaced items should be initialized by the user. prcrc and ptcrc. these value should be preset to all ones or all zeros, depending on the bcs used. parec. this 16-bit (modulo 2 16 ) counter is maintained by the cp. it may be initialized by the user while the channel is disabled. the counter counts parity errors on receive if the par- ity feature of bisync is enabled. table 7-9. bisync-specific parameters address name width description scc base + 30 res long reserved scc base + 34 crcc long crc constant temp value scc base + 38 prcrc word preset receiver crc16/lrc scc base + 3a ptcrc word preset transmitter crc16/lrc scc base + 3c parec word receive parity error counter scc base + 3e bsync word bisync sync character scc base + 40 bdle word bisync dle character scc base + 42 character1 word control character 1 scc base + 44 character2 word control character 2 scc base + 46 character3 word control character 3 scc base + 48 character4 word control character 4 scc base + 4a character5 word control character 5 scc base + 4c character6 word control character 6 scc base + 4e character7 word control character 7 scc base + 50 character8 word control character 8 scc base + 52 rccm word receive control character mask
serial communication controllers (sccs) 7-204 mc68360 user? manual motorola bsync. this register contains the value of the sync to be transmitted in an underrun con- dition, transmitted as the second byte of a dle-sync pair, and stripped from incoming data on receive once the receiver has synchronized to the data using the dsr and syn1?yn2 pair. bdle. this register contains the value to be transmitted as the first byte of a dle-sync pair and stripped on receive. character1?. these values represent control characters that may be recognized by the bisync controller. rccm. this value is used to mask the comparison of character1? so that classes of control characters may be defined. a one enables the bit comparison and a zero masks it. the cpu32+ core configures each scc to operate in one of the protocols by the mode bits in the gsmr. the syn1?yn2 synchronization characters are programmed in the data synchronization register. the bisync controller uses the same basic data structure as that used in the other modes. receive and transmit errors are reported through their respective bds. the status of the line is reflected via the port c pins, and a maskable interrupt can be generated upon each status change. there are two basic ways of handling the bisync channels. first, data may be inspected on a per-byte basis, with the bisync controller interrupting the cpu32+ core upon receipt of every byte of data. second, the bisync controller may be operated so that software is only necessary for handling the first two to three bytes of data; subsequent data (until the end of the block) can be handled by the bisync controller without interrupting the cpu32+ core. 7.10.20.5 bisync command set. the following transmit and receive commands are issued to the cr. 7.10.20.5.1 transmit commands. the following paragraphs describe the bisync trans- mit commands. stop transmit command . after a hardware or software reset and the enabling of the channel in the scc mode register, the channel is in the transmit enable mode and starts polling the first bd in the table every 64 transmit clocks (immediately if the tod bit in the todr is set). the stop transmit command aborts transmission after a maximum of 64 additional bits are transmitted, without waiting until the end of the buffer is reached, and the transmit fifo is flushed. the tbptr is not advanced. no new bd is accessed, and no new buffers are transmitted for this channel. sync characters consisting of sync-sync or dle-sync pairs (according to the transmitter mode) will be continually transmitted until transmission is reenabled by issuing the restart transmit command. the stop transmit com- mand may be used when it is necessary to abort transmission and transmit an eot control
serial communication controllers (sccs) motorola mc68360 user? manual 7-205 sequence. the eot sequence should be the first buffer presented to the bisync controller for transmission after re-enabling transmission. note the bisync controller will remain in the transparent or normal mode after receiving the stop transmit or restart transmit commands. graceful stop transmit command . the channel graceful stop transmit command is used to stop transmission in an orderly way rather than abruptly, as performed by the regular stop transmit command. it stops transmission after the current frame has completed transmission, or immediately if there is no frame being transmitted. the gra bit in the scce will be set once transmission has stopped. after transmission ceases, the bisync transmit parameters, including bds, may be modified. the tbptr will point to the next tx bd in the table. transmission will begin once the r-bit of the next bd is set and the restart transmit command is issued. restart transmit command . the restart transmit command enables the trans- mission of characters on the transmit channel. this command is expected by the bisync controller after a stop transmit command, after a stop transmit command and dis- abling the channel in its scc mode register, after a graceful stop transmit com- mand, or after a transmitter error (underrun or cts lost). the bisync controller will resume transmission from the current tbptr in the channel? tx bd table. init tx parameters command . initializes all the transmit parameters in this serial chan- nel? parameter ram to their reset state. this command should only be issued when the transmitter is disabled. note that the init tx and rx parameters command may also be used to reset both transmit and receive parameters. 7.10.20.5.2 receive commands. the following paragraphs describe the bisync receive commands. reset bcs calculation command . the reset bcs calculation command resets the receive bcs accumulator immediately. for example, it may be used to reset the bcs after recognizing a control character (such as soh), signifying that a new block is com- mencing. enter hunt mode command . after a hardware or software reset and the enabling of the channel in the scc mode register, the channel is in the receive enable mode and will use the first bd in the table. the enter hunt mode command is used to force the bisync controller to abort recep- tion of the current block and enter the hunt mode. in the hunt mode, the bisync controller continually scans the input data stream for the syn1?yn2 sequence as programmed in the data synchronization register. after receiving the command, the current receive buffer is closed, and the bcs is reset. message reception continues using the next bd.
serial communication controllers (sccs) 7-206 mc68360 user? manual motorola close rx bd command . the close rx bd command is used to force the scc to close the current rx bd, if it is currently being used, and to use the next bd for any subsequent data that is received. if the scc is not in the process of receiving data, no action is taken by this command. init rx parameters command . this command initializes all the receive parameters in this serial channel? parameter ram to their reset state. this command should only be issued when the receiver is disabled. note that the init tx and rx parameters com- mand may also be used to reset both receive and transmit parameters. 7.10.20.6 bisync control character recognition. the bisync controller can recognize special control characters. these characters are used to customize the bisync protocol implemented by the bisync controller and may be used to aid its operation in a dma-oriented environment. their main use is for receive buffers longer than one byte. in single-byte buffers, each byte can easily be inspected, and control character recognition should be disabled. the purpose of the control characters table is to enable automatic recognition (by the bisync controller) of the end of the current block. since the bisync controller imposes no restrictions on the format of the bisync blocks, user software must respond to the received characters and inform the bisync controller of mode changes and certain protocol events (e.g., resetting the bcs). however, correct use of the control characters table allows the remainder of the block to be received without interrupting the user software. up to 8 control characters may be defined. these characters inform the bisync controller that the end of the current block has been reached and whether a bcs is expected following this character. for example, the end of text (etx) character implies an end of block (etb) with a subsequent bcs. an enquiry (enq) character designates an end of block without a subsequent bcs. all the control characters are written into the data buffer. the bisync controller uses a table of 16-bit entries to support control character recognition. each entry consists of the control character, an end-of-table bit, a bcs expected bit, and a hunt mode bit. the rccm entry is used to define classes of control characters with a mask- ing option. 1514131211109876543210 offset + 0 e b h character1 offset + 2 e b h character2 offset + 4 e b h character3 offset + 6 e b h offset + e e b h character8 offset + 10 1 1 1 mask value(rccm)
serial communication controllers (sccs) motorola mc68360 user? manual 7-207 e?nd of table 0 = this entry is valid. the lower eight bits will be checked against the incoming char- acter. 1 = the entry is not valid. no valid entries exist beyond this entry. note in tables with 8 control characters, the e-bit should be zero in all eight positions. b?cs expected 0 = the character is written into the receive buffer. the buffer is then closed. 1 = the character is written into the receive buffer. the receiver waits for one lrc or two crc bytes of bcs and then closes the buffer. this should be used for etb, etx, and itb. note a maskable interrupt is generated after the buffer is closed. h?unt mode 0 = the bisync controller will maintain character synchronization after closing this buffer. 1 = the bisync controller will enter hunt mode after closing the buffer. when the b bit is set, the controller will enter hunt mode after the reception of the bcs. character1??ontrol character value these fields define control characters. note when using 7-bit characters with parity, the parity bit should be included in the control character value. rccm?eceived control character mask the value in this register is used to mask the comparison of character1?. the lower eight bits of rccm correspond to the lower eight bits of character1?, and are de- coded as follows. 0 = mask this bit in the comparison of the incoming character and character1?. 1 = the address comparison on this bit proceeds normally. no masking occurs. note bits 15 through 13 of rccm must be set, or erratic operation may occur during the control character recognition process. 7.10.20.7 bsync-bisync sync register. the 16-bit, memory-mapped, read-write bsync register is used to define the bisync stripping and insertion of the sync character. when an underrun occurs during message transmission, the bisync controller will insert sync characters until the next data buffer is available for transmission. when the bisync
serial communication controllers (sccs) 7-208 mc68360 user? manual motorola receiver is not in hunt mode and a sync character has been received, the receiver will dis- card this character if the valid bit is set. note when using 7-bit characters with parity, the parity bit should be included in the sync register value. 7.10.20.8 bdle-bisync dle register. the 16-bit, memory-mapped, read-write bdle register is used to define the bisync stripping and insertion of the dle character. when the bisync controller is in transparent mode and an underrun occurs during message transmission, the bisync controller inserts dle-sync pairs until the next data buffer is available for transmission. when the bisync receiver is in transparent mode and a dle character is received, the receiver discards this character and excludes it from the bcs if the valid bit is set. if the sec- ond (next) character is a sync character, the bisync controller discards it and excludes it from the bcs. if the second character is a dle, the bisync controller will write it to the buffer and include it in the bcs. if the character is not a dle or sync, the bisync control- ler will examine the control characters table and act accordingly. if the character is not in the table, the buffer will be closed with the dle follow character error (dle) bit set. if the valid bit is not set, the receiver will treat the character as a normal character. note when using 7-bit characters with parity, the parity bit should be included in the dle register value. 7.10.20.9 transmitting and receiving the synchronization sequence. the bisync channel can be programmed to transmit and receive a synchronization pat- tern. the pattern is defined in the dsr. the length of the sync pattern is defined in the synl bits in the gsmr. the receiver synchronizes on the synchronization pattern that is located in the dsr. if the synl bits specify a non-zero synchronization pattern, then the transmitter sends the entire contents of the dsr prior to each frame, starting with the lsb first. thus, the user may wish to repeat the desired sync pattern in the other dsr bits as well. 1514131211109876543210 v0000000 sync 1514131211109876543210 v0000000 dle 1514131211109876543210 4-bit sync 1514131211109876543210 8-bit sync 1514131211109876543210 16-bit sync
serial communication controllers (sccs) motorola mc68360 user? manual 7-209 7.10.20.10 bisync error-handling procedure. the bisync controller reports message reception and transmission error conditions using the channel bds, the error counters, and the bisync event register. the modem interface lines can also be directly monitored via the port c pins. 7.10.20.10.1 transmission errors. the following paragraphs describe various types of bisync transmission errors. transmitter underrun . when this error occurs, the channel terminates buffer transmission, closes the buffer, sets the un bit in the bd, and generates the txe interrupt (if enabled). the channel resumes transmission after the reception of the restart transmit com- mand. underrun cannot occur between frames or during a dle-xxx pair in transparent mode. cts lost during message transmission . when this error occurs, the channel terminates buffer transmission, closes the buffer, sets the cts lost bit in the bd, and generates the txe interrupt (if enabled). the channel will resume transmission after reception of the restart transmit command. 7.10.20.10.2 reception errors. the following paragraphs describe various types of bisync reception errors. overrun error . the bisync controller maintains an internal fifo for receiving data. the cp begins programming the sdma channel (if the data buffer is in external memory) and updat- ing the crc when the first byte is received into the fifo. if a fifo overrun occurs, the bisync controller writes the received data byte to the internal fifo over the previously received byte. the previous character and its status bits are lost. following this, the channel closes the buffer, sets the ov-bit in the bd, and generates the rx interrupt (if enabled). the receiver then enters hunt mode immediately. cd lost during message reception . when this error occurs, the channel terminates mes- sage reception, closes the buffer, sets the carrier detect lost bit in the bd, and generates the rx interrupt (if enabled). this error has the highest priority; the rest of the message is lost, and no other errors are checked in the message. the receiver then enters hunt mode imme- diately. parity error . when this error occurs, the channel writes the received character to the buffer and sets the pr bit in the bd. the channel terminates message reception, closes the buffer, sets the pr bit in the bd, and generates the rx interrupt (if enabled). the channel also increments the parec, and the receiver enters hunt mode immediately. crc error . the channel updates the cr bit in the bd every time a character is received with a byte delay (eight serial clocks) between the status update and the crc calculation. when using control character recognition to detect the end of the block and cause the checking of the crc that follows, the channel closes the buffer, sets the cr bit in the bd, and generates the rx interrupt (if enabled). 7.10.20.11 bisync mode register (psmr). each bisync mode register is a 16-bit, memory-mapped, read-write register that controls scc operation. the term bisync mode
serial communication controllers (sccs) 7-210 mc68360 user? manual motorola register refers to the psmr of the scc when that scc is configured for bisync mode. this register is cleared at reset. some of the psmr bits can be modified on the fly (i.e., while the receiver and transmitter are enabled). nos?inimum number of syncs between or before messages if nos3?os0 = 0000, then 1 syn1?yn2 pair will be transmitted; if nos3?os0 = 1111, then 16 syn1?yn2 pairs will be transmitted. the syn1?yn2 pair is defined in the dsr. the entire syn1?yn2 pair will always be transmitted regardless of the setting of the synl bits in the gsmr. the nos bits may be modified on the fly. crc?rc selection 00 = reserved. 01 = crc16 (bisync). (x16 + x15 + x2 + 1). the prcrc and ptcrc registers should be initialized to a preset value of all zeros or all ones before the channel is enabled. in both cases, the transmitter sends the calculated crc non-inverted, and the receiver checks the crc against zero. eight-bit data characters (without parity) are configured when crc16 is chosen. 10 = reserved 11 = lrc (sum check). (bisync). for even lrc, the prcrc and ptcrc registers should be initialized to zero before the channel is enabled. for odd lrc, the pr- crc and ptcrc registers should be initialized to ones. the receiver will check character parity when bcs is programmed to lrc and the receiver is not in transparent mode. the transmitter will transmit character parity when bcs is programmed to lrc and the transmitter is not in transparent mode. use of parity in bisync assumes the use of 7-bit data characters. rbcs?eceive block check sequence the bisync receiver internally stores two bcs calculations with a byte delay (eight serial clocks) between them. this enables the user to examine a received data byte and then decide whether or not it should be part of the bcs calculation. this is useful when control character recognition and stripping are to be performed in software. the bit should be set (or reset) within the time taken to receive the following data byte. when this bit is reset, the bcs calculations exclude the latest fully received data byte. when rbcs is set, the bcs calculations continue normally. 0 = disable receive bcs 1 = enable receive bcs rtr?eceiver transparent mode 0 = the receiver is placed in normal mode with sync stripping and control character recognition operative. 1 = the receiver is placed in transparent mode. syncs, dles, and control characters are only recognized after a leading dle character. the receiver will calculate the crc16 sequence, even if it is programmed to lrc while in transparent mode. pr- crc should be initialized to the crc16 preset value before setting this bit. 1514131211109876543210 nos crc rbcs rtr rvd drt rpm tpm
serial communication controllers (sccs) motorola mc68360 user? manual 7-211 rvd?everse data 0 = normal operation. 1 = any portion of this scc that is defined to operate in bisync mode (either the re- ceiver or transmitter or both) will operate by reversing the character bit order, trans- mitting the msb first. drt?isable receiver while transmitting 0 = normal operation. 1 = while data is being transmitted by the scc, the receiver is disabled, being gated by the internal rts signal. this is useful if the bisync channel is being configured onto a multidrop line, and the user does not wish to receive his own transmission. note that although bisync is usually implemented as a half-duplex protocol, the receiver is not actually disabled during transmission. thus, for typical bisync op- eration, drt should not be set. bits 5??eserved rpm?eceiver parity mode the rpm bits select the type of parity check to be performed by the receiver. the rpm bits can be modified on the fly. the rpm bits are ignored unless the crc bits are selected to be lrc. 00 = odd parity 01 = low parity (always check for a zero in the parity bit position) 10 = even parity 11 = high parity (always check for a one in the parity bit position) when odd parity is selected, the transmitter will count the number of ones in the data word. if the total number of ones is not an odd number, the parity bit is set to one and thus produces an odd number. if the receiver counts an even number of ones, an error in trans- mission has occurred. in the same manner, for even parity, an even number must result from the calculation performed at both ends of the line. in high/low parity, if the parity bit is not high/low, a parity error is reported. the receive parity errors cannot be disabled, but can be ignored if desired. tpm?ransmitter parity mode the tpm bits select the type of parity to be performed by the transmitter. the tpm bits can be modified on the fly. the tpm bits are ignored unless the crc bits are selected to be lrc. 00 = odd parity 01 = force low parity (always send a zero in the parity bit position) 10 = even parity 11 = force high parity (always send a one in the parity bit position) 7.10.20.12 bisync receive buffer descriptor (rx bd). the cp reports informa- tion about the received data for each buffer using bds. the cp closes the current buffer,
serial communication controllers (sccs) 7-212 mc68360 user? manual motorola generates a maskable interrupt, and starts to receive data into the next buffer after one of the following events: 1. receiving a user-defined control character 2. detecting an error 3. detecting a full receive buffer 4. issuing the enter hunt mode command 5. issuing the close rx bd command note: entries in boldface must be initialized by the user. e?mpty 0 = the data buffer associated with this rx bd has been filled with received data, or data reception has been aborted due to an error condition. the cpu32+ core is free to examine or write to any fields of this rx bd. the cp will not use this bd again while the e-bit remains zero. 1 = the data buffer associated with this rx bd is empty, or reception is currently in progress. this rx bd and its associated receive buffer are owned by the cp. once the e-bit is set, the cpu32+ core should not write any fields of this rx bd. bits 14, 8, 6, 5?eserved w?rap (final bd in table) 0 = this is not the last bd in the rx bd table. 1 = this is the last bd in the rx bd table. after this buffer has been used, the cp will receive incoming data into the first bd in the table (the bd pointed to by rbase). the number of rx bds in this table is programmable and is determined only by the w-bit and the overall space constraints of the dual-port ram. i?nterrupt 0 = no interrupt is generated after this buffer has been used. 1 = the rx bit in the bisync event register will be set when this buffer has been closed by the bisync controller. the rx bit can cause an interrupt if it is enabled. l?ast in frame this bit is set by the transparent controller when this buffer is the last in a frame. this implies the negation of cd in envelope mode or the reception of an error, in which 212 1514131211109876543210 offset + 0 e w ilf cm ?e nocrovcd offset + 2 data length offset + 4 rx data buffer pointer offset + 6
serial communication controllers (sccs) motorola mc68360 user? manual 7-213 case one or more of the ov, cd, and de bits are set. the transparent controller will write the number of frame octets to the data length field. 0 = the buffer is not the first in a frame. 1 = the buffer is the first in a frame f?irst in frame this bit is set by the transparent controller when this buffer is the first in a frame. 0 = the buffer is not the last in a frame. 1 = the buffer is the last in a frame cm?ontinuous mode 0 = normal operation. 1 = the e-bit is not cleared by the cp after this bd is closed, allowing the associated data buffer to be overwritten automatically when the cp next accesses this bd. however, the e-bit will be cleared if an error occurs during reception, regardless of the cm bit. de?pll error this bit is set by the bisync controller when a dpll error has occurred during the recep- tion of this buffer. in decoding modes where a transition is promised every bit, the dpll error will be set when a missing transition has occurred. ov?verrun a receiver overrun occurred during message reception. cd?arrier detect lost the carrier detect signal was negated during message reception. data length the data length is the number of octets that the cp has written into this bd? data buffer, including the bcs (if selected). in bisync mode, the data length should initially be set to zero by the user; it is incremented each time a received character is written to the data buffer. note the actual amount of memory allocated for this buffer should be greater than or equal to the contents of the mrblr. rx data buffer pointer the receive buffer pointer, which always points to the first location of the associated data buffer, may be even or odd. the buffer may reside in either internal or external memory. 7.10.20.13 bisync transmit buffer descriptor (tx bd). data is presented to the cp for transmission on an scc channel by arranging it in buffers referenced by the channel? tx bd table. the cp confirms transmission or indicates error conditions using the bds to inform the processor that the buffers have been serviced.
serial communication controllers (sccs) 7-214 mc68360 user? manual motorola the status and control bits are prepared by the user before transmission and are set by the cp after the buffer has been transmitted. note: entries in boldface must be initialized by the user. r?eady 0 = the data buffer associated with this bd is not ready for transmission. the user is free to manipulate this bd or its associated data buffer. the cp clears this bit after the buffer has been transmitted or after an error condition is encountered. 1 = the data buffer, which has been prepared for transmission by the user, has not been transmitted or is currently being transmitted. no fields of this bd may be writ- ten by the user once this bit is set. w?rap (final bd in table) 0 = this is not the last bd in the tx bd table. 1 = this is the last bd in the tx bd table. after this buffer has been used, the cp will receive incoming data into the first bd in the table (the bd pointed to by tbase). the number of tx bds in this table is programmable, and is determined only by the w-bit and the overall space constraints of the dual-port ram. i?nterrupt 0 = no interrupt is generated after this buffer has been serviced. 1 = either tx or txe in the bisync event register will be set when this buffer has been serviced by the cp, which can cause an interrupt. l?ast in message 0 = the last character in the buffer is not the last character in the current block. 1 = the last character in the buffer is the last character in the current block. the trans- mitter will enter (remain in) normal mode after sending the last character in the buff- er and the bcs (if enabled). tb?ransmit bcs this bit is valid only when the l-bit is set. 0 = transmit the syn1?yn2 sequence or idle (according to the rtsm bit in the gsmr) after the last character in the buffer. 1 = transmit the bcs sequence after the last character. the bisync controller will also reset the bcs generator after transmitting the bcs. cm?ontinuous mode 0 = normal operation. 1 = the r-bit is not cleared by the cp after this bd is closed, allowing the associated data buffer to be retransmitted automatically when the cp next accesses this bd. 1514131211109876543210 offset + 0 r wi ltbcmbrtdtrb un ct offset + 2 data length offset + 4 tx data buffer pointer offset + 6
serial communication controllers (sccs) motorola mc68360 user? manual 7-215 however, the r-bit will be cleared if an error occurs during transmission, regard- less of the cm bit. br?cs reset 0 = the transmitter bcs accumulation is not reset. 1 = the transmitter bcs accumulation is reset (used for stx or soh) before sending the data buffer. td?ransmit dle 0 = no automatic dle transmission is to occur before the data buffer. 1 = the transmitter will transmit a dle character before sending the data buffer, which saves writing the first dle to a separate data buffer when working in transparent mode. see the tr bit for information on control characters. tr?ransparent mode 0 = the transmitter will enter (remain in) the normal mode after sending the data buffer. in this mode, the transmitter will automatically insert syncs in an underrun condi- tion. 1 = the transmitter enters or remains in transparent mode after sending the data buff- er. in this mode, the transmitter automatically inserts dle-sync pairs in the un- derrun condition. underrun occurs when the bisync controller finishes a buffer with the l-bit set to zero and the next bd is not available. the transmitter also checks all characters before sending them; if a dle is detected, another dle is automatically sent. the user must insert a dle or program the bisync controller to insert it (using td) before each control character required. the transmitter will calculate the crc16 bcs even if the bcs bit in the bisync mode register is pro- grammed to lrc. the ptcrc should be initialized to crc16 before setting this bit. b?cs enable 0 = buffer consists of characters to be excluded from the bcs accumulation. 1 = buffer consists of characters to be included in the bcs accumulation. the following status bits are written by the cp after it has finished transmitting the associ- ated data buffer. un?nderrun the bisync controller encountered a transmitter underrun condition while transmitting the associated data buffer. ct?ts lost cts was lost during message transmission. data length the data length is the number of octets that the cp should transmit from this bd? data buffer. it is never modified by the cp. the data length should be greater than zero.
serial communication controllers (sccs) 7-216 mc68360 user? manual motorola tx data buffer pointer the transmit buffer pointer, which always points to the first byte of the associated data buffer, may be even or odd. the buffer may reside in either internal or external memory. 7.10.20.14 bisync event register (scce). the scce is called the bisync event register when the scc is operating as a bisync controller. it is a 16-bit register used to report events recognized by the bisync channel and to generate interrupts. on recognition of an event, the bisync controller will set the corresponding bit in the bisync event reg- ister. interrupts generated by this register may be masked in the bisync mask register. the bisync event register is a memory-mapped register that may be read at any time. a bit is reset by writing a one (writing a zero does not affect a bit? value). more than one bit may be reset at a time. all unmasked bits must be reset before the cp will negate the inter- nal interrupt request signal. this register is cleared at reset. bits 15?3, 9, 8, 6, 5?eserved glr?litch on rx a clock glitch was detected by this scc on the receive clock. glt?litch on tx a clock glitch was detected by this scc on the transmit clock. dcc?pll cs changed the carrier sense status as generated by the dpll has changed state. the real-time sta- tus may be found in sccs. this is not the cd pin status that is discussed elsewhere; it is only valid when the dpll is used. gra?raceful stop complete a graceful stop, which was initiated by the graceful stop transmit command, is now complete. this bit is set as soon the transmitter has finished transmitting any mes- 1514131211109876543210 glr glt dcc gra txe rch bsy tx rx
serial communication controllers (sccs) motorola mc68360 user? manual 7-217 sage that was in progress when the command was issued. it will be set immediately if no message was in progress when the command was issued. txe?x error an error (cts lost or underrun) occurred on the transmitter channel. rch?eceive character a character has been received and written to the buffer. bsy?usy condition a character was received and discarded due to lack of buffers. the receiver will resume reception after an enter hunt mode command. tx?x buffer a buffer has been transmitted. this bit is set as the last bit of data or the bcs (if sent) begins transmission. rx?x buffer a receive buffer has been closed by the cp on the bisync channel. 7.10.20.15 bisync mask register (sccm). the sccm is referred to as the bisync mask register when the scc is operating as a bisync controller. it is a 16-bit read-write register that has the same bit format as the bisync event register. if a bit in the bisync mask register is a one, the corresponding interrupt in the event register will be enabled. if the bit is zero, the corresponding interrupt in the event register will be masked. this register is cleared upon reset. 7.10.20.16 scc status register (sccs). the sccs is an 8-bit read-only register that allows the user to monitor real-time status conditions on the rxd line. the real-time status of the cts and cd pins are part of the port c parallel i/o. cs?arrier sense (dpll) this bit shows the real-time carrier sense of the line as determined by the dpll if it is used. 0 = the dpll does not sense a carrier. 1 = the dpll does sense a carrier. 7.10.20.17 programming the bisync controller. there are two general tech- niques that the software may employ to handle data received by the bisync controllers. the simplest way is to allocate single-byte receive buffers, request (in the status word in each bd) an interrupt on reception of each buffer (i.e., byte), and implement the bisync protocol entirely in software on a byte-by-byte basis. this simple approach is flexible and may be adapted to any bisync implementation. the obvious penalty is the overhead caused by interrupts on each received character. 76543210 cs
serial communication controllers (sccs) 7-218 mc68360 user? manual motorola a more efficient method is as follows. multibyte buffers are prepared and linked to the receive buffer table. software is used to analyze the first two to three bytes of the buffer to determine what type of block is being received. when this has been determined, reception can continue without further intervention from the user? software until a control character is encountered. the control character signifies the end of the block, causing the software to revert back to a byte-by-byte reception mode. to accomplish this, the rch bit in the bisync mask register should initially be set, enabling an interrupt on every byte of data received to allow software to analyze the type of block being received on a byte-by-byte basis. after analyzing the initial characters of a block, the user should either set the rtr bit in the bisync mode register or issue the reset bcs calculation command. for example, if dle-stx is received, transparent mode should be entered. by setting the appropriate bit in the bisync mode register, the bisync con- troller automatically strips the leading dle from sequences. thus, control characters are only recognized when they follow a dle character. the rtr bit should be cleared after a dle-etx is received. alternatively, after receiving an soh, the reset bcs calculation command should be issued. this command causes the soh to be excluded from bcs accumulation and the bcs to be reset. note that the rbcs bit in the bisync mode register (used to exclude a character from the bcs calculation) is not needed here since syncs and leading dles (in transparent mode) are automatically excluded by the bisync controller. after recognizing the type of block above, the rch interrupt should be masked. data recep- tion then continues without further interruption of the cpu32+ core until the end of the cur- rent block is reached. this is defined by the reception of a control character matching that programmed in the receive control characters table. the control characters table should be set to recognize the end of the block as follows: after the end of text (etx), a bcs is expected; then the buffer should be closed. hunt mode should be entered when the line turnaround occurs (bisync is normally half-duplex). enq characters are used to abort transmission of a block. for the receiver, the enq character designates the end of the block, but no crc is expected. following control character reception (i.e., end of the block), the rch bit in the bisync mask register should be set, reenabling interrupts for each byte of received data. 7.10.20.18 scc bisync example. the following list is an initialization sequence for an scc bisync channel assuming an external clock is provided. scc4 is used. the bisync control characters e b h etx 0 1 1 itb 0 1 0 etb 0 1 1 enq 0 0 0 next entry 0 x x
serial communication controllers (sccs) motorola mc68360 user? manual 7-219 controller is configured with the rts4 , cts4 , and cd4 pins active. the clk7 pin is used for both the bisync receiver and transmitter. 1. the sdcr (sdma configuration register) should be initialized to $0740, rather than being left at its default value of $0000. 2. configure the port a pins to enable the txd4 and rxd4 pins. write papar bits 6 and 7 with ones. write padir bits 6 and 7 with zeros. write paodr bits 6 and 7 with zeros. 3. configure the port c pins to enable rts4 , cts4 , and cd4 . write pcpar bit 3 with one and bits 10 and 11 with zeros. write pcdir bits 3, 10, and 11 with zeros. write pcso bits 10 and 11 with ones. 4. configure port a to enable the clk7 pin. write papar bit 14 with a one. write padir bit 14 with a zero. 5. connect the clk7 pin to scc4 using the si. write the r4cs bits in sicr to 110. write the t4cs bits in sicr to 110. 6. connect the scc4 to the nmsi (i.e., its own set of pins). clear the sc4 bit in the sicr. 7. write $0740 to the sdcr to initialize the sdma configuration register. 8. write rbase and tbase in the scc parameter ram to point to the rx bd and tx bd in the dual-port ram. assuming one rx bd at the beginning of dual-port ram, and one tx bd following that rx bd, write rbase with $0000 and tbase with $0008. 9. program the cr to execute the init rx & tx params command for this channel. for instance, to execute this command for scc1, write $0001 to the cr. this com- mand causes the rbptr and tbptr parameters of the serial channel to be updated with the new values just programmed into rbase and tbase. 10. write rfcr with $18 and tfcr with $18 for normal operation. 11. write mrblr with the maximum number of bytes per receive buffer. for this case, assume 16 bytes, so mrblr = $0010. 12. write prcrc with $0000 to comply with crc16. 13. write ptcrc with $0000 to comply with crc16. 14. clear parec for the sake of clarity. 15. write bsync with $8033, assuming a sync value of $33. 16. write bdle with $8055, assuming a dle value of $55. 17. write character1? with $8000. they are not used. 18. write rccm with $e0ff. it is not used. 19. initialize the rx bd. assume the rx data buffer is at $00001000 in main memory. write $b000 to rx_bd_status. write $0000 to rx_bd_length (not required done for instructional purposes only). write $00001000 to rx_bd_pointer. 20. initialize the tx bd. assume the tx data buffer is at $00002000 in main memory and contains five 8-bit characters. write $bd20 to tx_bd_status. write $0005 to
serial communication controllers (sccs) 7-220 mc68360 user? manual motorola tx_bd_length. write $00002000 to tx_bd_pointer. 21. write $ffff to the scce to clear any previous events. 22. write $0013 to the sccm to enable the txe, tx, and rx interrupts. 23. write $08000000 to the cimr to allow scc4 to generate a system interrupt. (the cicr should also be initialized.) 24. write $00000020 to gsmr_h4 to configure a small receive fifo width. 25. write $00000008 to gsmr_l4 to configure the cts and cd pins to automatically control transmission and reception (diag bits) and the bisync mode. notice that the transmitter (ent) and receiver (enr) have not been enabled yet. 26. set the psmr4 to $0600 to configure crc16, crc checking on receive, and normal operation (not transparent). 27. write $00000038 to gsmr_l4 to enable the scc4 transmitter and receiver. this additional write ensures that the ent and enr bits will be enabled last. note after 5 bytes have been transmitted, the tx bd is closed. addi- tionally, the receive buffer is closed after 16 bytes have been re- ceived. any additional receive data beyond 16 bytes will cause a busy (out-of-buffers) condition since only one rx bd was pre- pared. 7.10.21 transparent controller the transparent controller allows the transmission and reception of serial data over an scc without any modification to that data stream. transparent mode provides a clear channel on which no bit-level manipulation is performed by the scc. any protocol run over transparent mode is performed in software. the job of an scc in transparent mode is to function simply as a high-speed serial-to-parallel and parallel-to-serial converter. this mode is also referred to as "totally transparent" or "promiscuous" operation. there are several basic applications for transparent mode. first, some data may need to be moved serially, but requires no protocol superimposed?or example, voice data. second, some board-level applications require a serial-to-parallel and parallel-to-serial conversion. often this is done to allow communication between chips on the same board. third, some applications require the switching of data without interfering with the protocol encoding itself. for instance, in a multiplexer, data from a high-speed time-multiplexed serial stream is mul- tiplexed into multiple low-speed data streams. the concept is to switch the data path, not alter the protocol encoded on that data path. by appropriately setting the gsmr, any of the scc channels may be configured to function in transparent mode. the quicc can both receive and transmit the entire serial bit stream transparently. this mode is configured by selecting the ttx and trx bits in the in the gsmr for the transmitter and receiver, respectively. both bits must be set for full-duplex transpar- ent operation.
serial communication controllers (sccs) motorola mc68360 user? manual 7-221 if just one of the ttx or trx bits is set, the other half of the scc can operate with another protocol as programmed in the mode bits of the gsmr. (this allows loopback modes to dma data from one memory location to another while converting the data to a specific serial format.) the scc in transparent mode can work with the tsa or nmsi. the scc can support modem lines using the general-purpose i/o pins. the data can be transmitted and received with msb or lsb first in each octet. the scc in transparent mode consists of separate transmit and receive sections whose operations are asynchronous with the cpu32+ core and may be either synchronous or asynchronous with respect to the other sccs. each clock can be supplied from the internal baud rate generator bank, dpll output, or external pins. 7.10.21.1 transparent controller features. the transparent controller con- tains the following key features: flexible data buffers automatic sync detection on receive ?6-bit pattern ?-bit pattern ?-bit pattern ?xternal sync pin support crcs can optionally be transmitted and received reverse data mode another protocol can be performed on the scc? other half (transmitter or receiver) during transparent mode mc68302-compatible sync options 7.10.21.2 transparent channel frame transmission processing. the transparent transmitter is designed to work with almost no intervention from the cpu32+ core. when this cpu32+ core enables the scc transmitter in transparent mode, it will start transmitting idles. the scc polls the first bd in the transmit channel? bd table. when there is a message to transmit, the scc will fetch the data from memory, load the transmit fifo, and wait for transmitter synchronization before starting to transmit the message. transmitter synchronization can be achieved using the cts pin or waiting for the receiver to achieve synchronization, depending on the txsy bit in the gsmr. see 7.10.21.4 achiev- ing synchronization in transparent mode for more details. once transmitter synchronization is achieved, transmission begins. when a bd? data has been completely transmitted, the last in message (l) bit is checked. if the l-bit is set, the scc writes the message status bits into the bd and clears the r-bit. it will then start transmitting idles until the next bd is ready. (even if the next bd is already ready, some idles will still be transmitted.) the transmitter will only begin transmission again after it achieves synchronization.
serial communication controllers (sccs) 7-222 mc68360 user? manual motorola when the end of the current bd has been reached and the l-bit is cleared (working in mul- tibuffer mode), only the r-bit is cleared, and the transmitter moves immediately to the next buffer to begin it transmission, with no gap on the serial line between buffers. failure to pro- vide the next buffer in time results in a transmit underrun, causing the txe bit in the trans- parent event register to be set. in both cases, an interrupt is issued according to the interrupt (i) bit in the bd. by appropri- ately setting the i-bit in each bd, interrupts can be generated after the transmission of each buffer or a after a group of buffers have been transmitted. the scc will then proceed to the next bd in the table. any whole number of bytes may be transmitted. if the revd bit in the gsmr is set, each data byte will be reversed in its bit order before transmission, transmitting the msb of each octet first. an option is available to decrease the latency of the transmitter by decreasing the transmit fifo size. this option is enabled by the tfl bit in the gsmr. the user, however, should note that this option can cause transmitter underruns at higher transmission speeds. an optional crc may be appended to each transparent frame if enabled in the tx bd. the crc pattern is chosen in the tcrc bits in the gsmr. 7.10.21.3 transparent channel frame reception processing. when the cpu32+ core enables the scc receiver in transparent mode, it will wait to achieve synchro- nization before beginning to receive data. the receiver can be synchronized to the data by a synchronization pulse or by a sync pattern. see 7.10.21.4 achieving synchronization in transparent mode for more details. after a buffer is filled, the scc clears the empty (e) bit in the bd and generates an interrupt if the interrupt (i) bit in the bd is set. it then moves to the next rx bd in the table and begins moving data to its associated buffer. if the next buffer is not available when needed, a busy condition is signified by the setting of the bsy bit in the transparent event register, which can generate a maskable interrupt. the receiver will revert to the hunt mode upon receiving the enter hunt mode command or recognizing an error condition such as a lack of receive buffers, detection of cd lost, or a receiver overrun. if the revd bit in the gsmr is set, each data byte will be reversed in its bit order before it is written to memory. an option is available to decrease the latency of the receiver by decreasing the receive fifo width. this option is enabled by the rfw bit in the gsmr. the user, however, should note that this option can cause receiver overruns at higher transmission speeds. the receiver always checks the crc of the frame that is received, according to the tcrc bits in the gsmr. if a crc is not required, the resulting errors may be ignored.
serial communication controllers (sccs) motorola mc68360 user? manual 7-223 7.10.21.4 achieving synchronization in transparent mode. once the scc transmitter is enabled for transparent operation in the gsmr, the tx bd is prepared for the scc, and the transmit fifo has been preloaded by the sdma channel, one additional pro- cess must occur before data can be transmitted?.e., transmit synchronization. similarly, once the scc receiver is enabled for transparent operation in the gsmr and the rx bd is made empty for the scc, one additional process must occur before data can be received?eceive synchronization. the synchronization process gives the user bit-level control over when the transmission and reception can begin. there are two basic methods: an in-line synchronization pattern and external synchronization signals. 7.10.21.4.1 in-line synchronization pattern. the transparent channel can be pro- grammed to transmit and receive a synchronization pattern if the synl bits in the gsmr are non-zero. the pattern is defined in the dsr. the length of the sync pattern is defined in the synl bits in the gsmr. the receiver synchronizes on the synchronization pattern that is located in the dsr. for instance, if a 4-bit sync is selected, then reception begins as soon as these four bits are received, beginning with the first bit following the 4-bit sync. the transmitter can synchronize on the receiver pattern if the rsyn bit in the gsmr is set. this effectively links the transmitter synchronization to the receiver synchronization. external synchronization signals if the synl bits in the gsmr are programmed to 00, an external signal is used to begin the sequence. the cts pin is used for the transmitter, and the cd pin is used for the receiver. the cd and cts pins share two options: the pulse option and the sampling option. the pulse option determines whether the cd pin or cts pins need only be asserted once to begin reception/transmission or whether the cd pin or cts pins must be asserted and stay asserted for the duration of the transparent frame. this is controlled by the cdp and ctsp bits in the gsmr. if the user expects a continuous stream of data without interruption, then the pulse operation should be used. however, if the user is trying to identify frames of transparent data, then the envelope mode of the cd and cts pins should be used. note the mc68302 transparent mode offered the exsyn bit, which, when set, gave the pulse behavior. 1514131211109876543210 4-bit sync 1514131211109876543210 8-bit sync 1514131211109876543210 16-bit sync
serial communication controllers (sccs) 7-224 mc68360 user? manual motorola the sampling option determines the delay between cd and cts being asserted and the resulting action by the scc. the cd or cts pins may be assumed to be asynchronous to the data and then internally synchronized by the scc, or the cd or cts pins may be assumed to be synchronous to the data giving faster operation. this option allows the rts pin of one scc to be connected to the cd pin of another scc (on another quicc) and to have the data synchronized and bit aligned. note the mc68302 transparent mode only offered the asynchronous option. diagrams for the pulse/envelope and sampling options may be found in 7.10.11 scc timing control. lastly, an option exists to link the transmitter synchronization to the receiver synchroniza- tion. 7.10.21.4.2 transparent synchronization example. figure 7-64 shows an example of synchronization using external signals.
serial communication controllers (sccs) motorola mc68360 user? manual 7-225 figure 7-64. sending transparent frames between quiccs quicc1 and quicc2 exchange transparent frames and synchronize each other using the rts and cd pins. the cts pin is not required since transmission may begin at any time. thus, the rts signal is directly connected to the other quicc? cd pin. the rsyn option in gsmr is not used, and transmission and reception from each quicc are independent. 7.10.21.5 transparent memory map. when configured to operate in transparent mode, the quicc overlays the structure listed in table 7-5 onto the protocol-specific area of the scc parameter ram listed in table 7-10. note: the boldfaced items should be initialized by the user. table 7-10. transparent-specific parameters address name width description scc base + 30 crc_p long crc preset for totally transparent scc base + 34 crc_c long crc constant for totally transparent receiver txd rts first bit of frame data last bit of frame data or crc brgox (output is clkx input) (output is rxd input) (output is cd input) notes: 1. cts should be configured as always asserted in the port c parallel i/o or else connected to ground externally. 2. the required gsmr configurations are: diag = 00, ctss = 1, ctsp is a don't care, cds = 1, cdp = 0, ttx = 1, and trx = 1. revd and tcrc are application dependent. 3. the transparent frame will contain a crc if the tc bit is set in the tx bd. quicc 1 quicc 2 txd rts rxd cd cd rts txd rxd brgox clkx notes: 1. each quicc generates its own transmit clocks. if the transmit and receive clocks are the same, it is possible for one quicc to generate transmit and receive clocks for the other quicc (for example, clkx on quicc 2 could be used to clock the transmitter and receiver). brgox clkx cd lost condition terminates reception of frame l = 1 in tx bd causes negation of rts
serial communication controllers (sccs) 7-226 mc68360 user? manual motorola crc_p . for the 16-bit crc-ccitt, crc_p should be initialized with $0000ffff. for the 32-bit crc-ccitt, crc_p should be initialized with $ffffffff. for the crc-16, crc_p should be initialized with ones ($0000ffff) or zeros ($00000000). crc_c. for the 16-bit crc-ccitt, crc_c should be initialized with $0000f0b8. for the 32-bit crc-ccitt, crc_c should be initialized with $debb20e3. for the crc-16 which is normally used with bisync, crc_c should be initialized with $00000000. note this value overlaps with the crc constant (mask) for the hdlc- based protocols. this overlap is not detrimental since the crc constant (mask) is only used for the receiver; thus, only one en- try is required. therefore, the user may choose hdlc transmit- ter with a transparent receiver or a transparent transmitter with an hdlc receiver. 7.10.21.6 transparent command set. the following transmit and receive com- mands are issued to the cr. 7.10.21.6.1 transmit commands. the following paragraphs describe the transparent transmit commands. stop transmit command . after a hardware or software reset and the enabling of the channel in the scc mode register, the channel is in the transmit enable mode and starts polling the first bd in the table every 64 clocks (immediately if the tod bit in the todr is set). the stop transmit command disables the transmission of frames on the transmit chan- nel. if this command is received by the transparent controller during frame transmission, transmission of that buffer is aborted after a maximum of 64 additional bits are transmitted, and the transmit fifo is flushed. the tbptr is not advanced, no new bd is accessed, and no new buffers are transmitted for this channel. the transmitter will send idles. graceful stop transmit command . the graceful stop transmit command is used to stop transmission in an orderly way, rather than abruptly as performed by the reg- ular stop transmit command. it stops transmission after the current frame has com- pleted transmission, or immediately if there is no frame being transmitted. (a transparent frame is not complete until a bd with the l-bit set has its associated buffer completely trans- mitted.) the gra bit in the scce will be set once transmission has stopped. after transmis- sion ceases, the transmit parameters, including bds, may be modified. the tbptr will point to the next tx bd in the table. transmission will begin once the r-bit of the next bd is set and the restart transmit command is issued. restart transmit command . the restart transmit command reenables the transmission of characters on the transmit channel. this command is expected by the trans- parent controller after a stop transmit command, after a stop transmit command and disabling the channel in its scc mode register, after a graceful stop transmit
serial communication controllers (sccs) motorola mc68360 user? manual 7-227 command, or after a transmitter error (underrun or cts lost). the transparent controller will resume transmission from the current tbptr in the channel? tx bd table. init tx parameters command. this command initializes all transmit parameters in this serial channel? parameter ram to their reset state. this command should only be issued when the transmitter is disabled. note that the init tx and rx parameters command may also be used to reset both transmit and receive parameters. 7.10.21.6.2 receive commands. the following paragraphs describe the transparent receive commands. enter hunt mode command . after a hardware or software reset and the enabling of the channel in the scc mode register, the channel is in the receive enable mode and will use the first bd in the table. the enter hunt mode command is used to force the transparent receiver to abort reception of the current frame and enter the hunt mode. in the hunt mode, the transparent controller waits for the synchronization sequence. after receiving the command, the current receive buffer is closed. further data reception will use the next bd. close rx bd command . the close rx bd command is used to force the scc to close the rx bd, if it is currently being used, and to use the next bd for any subsequent data that is received. if the scc is not in the process of receiving data, no action is taken by this com- mand. init rx parameters command . this command initializes all the receive parameters in this serial channel? parameter ram to their reset state. this command should only be issued when the receiver is disabled. note that the init tx and rx parameters com- mand may also be used to reset both receive and transmit parameters. 7.10.21.7 transparent error-handling procedure. the scc reports mes- sage reception and transmission error conditions using the channel bds, the error counters, and the scc event register. 7.10.21.7.1 transmission errors. the following paragraphs describe various types of transmission errors. transmitter underrun . when this error occurs, the channel terminates buffer transmission, closes the buffer, sets the un bit in the bd, and generates the txe interrupt (if enabled). the channel resumes transmission after the reception of the restart transmit com- mand. underrun can occur after a transmit frame for which the l-bit in the tx bd was not set. in this case, only the txe bit is set. underrun cannot occur between transparent frames. cts lost during message transmission . when this error occurs, the channel terminates buffer transmission, closes the buffer, sets the ct bit in the bd, and generates the txe interrupt if it is enabled. the channel will resume transmission after the reception of the restart transmit command.
serial communication controllers (sccs) 7-228 mc68360 user? manual motorola 7.10.21.7.2 reception errors. the following paragraphs describe various types of recep- tion errors. overrun error . the scc maintains an internal fifo for receiving data. the cp begins pro- gramming the sdma channel (if the data buffer is in external memory) and updating the crc when 8 or 32 bits (according to the rfw bit in the gsmr) are received in the fifo. if a fifo overrun occurs, the scc writes the received data byte to the internal fifo over the previously received byte. the previous character and its status bits are lost. following this, the channel closes the buffer, sets the ov bit in the bd, and generates the rx interrupt (if enabled). the receiver then enters hunt mode immediately. cd lost during message reception . when this error occurs, the channel terminates mes- sage reception, closes the buffer, sets the cd bit in the bd, and generates the rx interrupt (if enabled). this error has the highest priority; the rest of the message is lost, and no other errors are checked in the message. the receiver then enters hunt mode immediately. 7.10.21.8 transparent mode register (psmr). the psmr is called the transpar- ent mode register when an scc is programmed for transparent mode. however, since all transparent mode selections are in the gsmr, this register is not used by the transparent controller. if transparent mode is only selected for the transmitter/receiver, then the trans- mitter/receiver may be programmed to support another protocol. in such a case, the psmr may be used for that other protocol. 7.10.21.9 transparent receive buffer descriptor (rx bd). ?he cp reports information about the received data for each buffer using an rx bd. the cp closes the current buffer, generates a maskable interrupt, and starts to receive data into the next buffer after one of the following events: 1. detecting an error 2. detecting a full receive buffer 3. issuing the enter hunt mode command 4. issuing the close rx bd command note: entries in boldface must be initialized by the user. e?mpty 0 = the data buffer associated with this rx bd has been filled with received data, or data reception has been aborted due to an error condition. the cpu32+ core is free to examine or write to any fields of this rx bd. the cp will not use this bd again while the e-bit remains zero. 1514131211109876543210 offset + 0 e wi l fcm ?e nocrovcd offset + 2 data length offset + 4 rx data buffer pointer* offset + 6
serial communication controllers (sccs) motorola mc68360 user? manual 7-229 1 = the data buffer associated with this bd is empty, or reception is currently in progress. this rx bd and its associated receive buffer are owned by the cp. once the e-bit is set, the cpu32+ core should not write any fields of this rx bd. bits 14, 10, 8, 6, 5, 3?eserved w?rap (final bd in table) 0 = this is not the last bd in the rx bd table. 1 = this is the last bd in the rx bd table. after this buffer has been used, the cp will receive incoming data into the first bd in the table (the bd pointed to by rbase). the number of rx bd s in this table is programmable and is determined only by the w-bit and the overall space constraints of the dual-port ram. i?nterrupt 0 = no interrupt is generated after this buffer has been used. 1 = when this buffer has been closed by the transparent controller, the rx bit in the transparent event register will be set. the rx bit can cause an interrupt if it is en- abled. l?ast in frame this bit is set by the transparent controller when this buffer is the last in a frame. this im- plies the negation of cd in envelope mode or the reception of an error, in which case one or more of the ov, cd, and de bits are set. the transparent controller will write the num- ber of frame octets to the data length field. 0 = this buffer is not the last in a frame. 1 = this buffer is the last in a frame. f?irst in frame this bit is set by the transparent controller when this buffer is the first in a frame. 0 = the buffer is not the first in a frame. 1 = the buffer is the first in a frame. cm?ontinuous mode 0 = normal operation. 1 = the e-bit is not cleared by the cp after this bd is closed, allowing the associated data buffer to be overwritten automatically when the cp next accesses this bd. however, the e-bit will be cleared if an error occurs during reception, regardless of the cm bit. de?pll error this bit is set by the transparent controller when a dpll error has occurred during the reception of this buffer. in decoding modes where a transition is promised every bit, the dpll error will be set when a missing transition occurs. no?x nonoctet aligned frame a frame that contained a number of bits not exactly divisible by eight was received.
serial communication controllers (sccs) 7-230 mc68360 user? manual motorola cr?rc error indication bits this frame contains a crc error. the received crc bytes are always written to the re- ceive buffer. ov?verrun a receiver overrun occurred during buffer reception. cd?arrier detect lost the carrier detect signal was negated during buffer reception. data length the data length is the number of octets that the cp has written into this bd? data buffer. it is written only once by the cp as the buffer is closed. note the actual amount of memory allocated for this buffer should be greater than or equal to the contents of the maximum receive buffer length register (mrblr). rx buffer pointer the receive buffer pointer, which always points to the first location of the associated data buffer, must be divisible by 4 (unless the rfw bit in the gsmr is set to 8-bits wide, in which case it may be even or odd). the buffer may reside in either internal or external memory. 7.10.21.10 transparent transmit buffer descriptor (tx bd). data is pre- sented to the cp for transmission on an scc channel by arranging it in buffers referenced by the channel? tx bd table. the cp confirms transmission or indicates error conditions using the bds to inform the processor that the buffers have been serviced. the status and control bits are prepared by the user before transmission and are set by the cp after the buffer has been transmitted. note: entries in boldface must be initialized by the user. r?eady 0 = the data buffer associated with this bd is not ready for transmission. the user is free to manipulate this bd or its associated data buffer. the cp clears this bit after the buffer has been transmitted or after an error condition is encountered. 1 = the data buffer, which has been prepared for transmission by the user, has not been transmitted or is currently being transmitted. no fields of this bd may be writ- ten by the user once this bit is set. 1514131211109876543210 offset + 0 r wi ltccm unct offset + 2 data length offset + 4 tx data buffer pointer offset + 6
serial communication controllers (sccs) motorola mc68360 user? manual 7-231 w?rap (final bd in table) 0 = this is not the last bd in the tx bd table. 1 = this is the last bd in the tx bd table. after this buffer has been used, the cp will receive incoming data into the first bd in the table (the bd pointed to by tbase). the number of tx bds in this table is programmable, and is determined only by the w-bit and the overall space constraints of the dual-port ram. i?nterrupt 0 = no interrupt is generated after this buffer has been serviced. 1 = when this buffer is serviced by the cp, tx, or txe bit in the transparent event reg- ister will be set. the tx and txe bits can cause interrupts if they are enabled. l?ast in message 0 = the last byte in the buffer is not the last byte in the transmitted transparent frame. data from the next transmit buffer (if ready) will be transmitted immediately follow- ing the last byte of this buffer. 1 = the last byte in the buffer is the last byte in the transmitted transparent frame. after this buffer is transmitted, the transmitter will require synchronization before the next buffer will be transmitted. tc?ransmit crc 0 = no crc sequence will be transmitted after this buffer. 1 = a frame check sequence as defined by the tcrc bits in the gsmr will be trans- mitted after the last byte of this buffer. cm?ontinuous mode 0 = normal operation. 1 = the r-bit is not cleared by the cp after this bd is closed, allowing the associated data buffer to be retransmitted automatically when the cp next accesses this bd. however, the r-bit will be cleared if an error occurs during transmission, regard- less of the cm bit. un?nderrun the scc encountered a transmitter underrun condition while transmitting the associated data buffer. ct?ts lost cts was lost during frame transmission. data length the data length is the number of bytes that the cp should transmit from this bd? data buffer. the data length, which should be greater than zero, may be even or odd. this val- ue is never modified by the cp. tx data buffer pointer the transmit buffer pointer, which always points to the first byte of the associated data buffer, may be even or odd. the buffer may reside in either internal or external memory.
serial communication controllers (sccs) 7-232 mc68360 user? manual motorola 7.10.21.11 transparent event register (scce). the scce is called the trans- parent event register when the scc is operating as a transparent controller. it is a 16-bit reg- ister used to report events recognized by the transparent channel and to generate interrupts. on recognition of an event, the transparent controller will set the corresponding bit in the transparent event register. interrupts generated by this register may be masked in the trans- parent mask register. the transparent event register is a memory-mapped register that may be read at any time. a bit is reset by writing a one (writing a zero does not affect a bit? value). more than one bit may be reset at a time. all unmasked bits must be reset before the cp will negate the inter- nal interrupt request signal. this register is cleared at reset. bits 15?3, 9?, 6??eserved glr?litch on rx a clock glitch was detected by this scc on the receive clock. glt?litch on tx a clock glitch was detected by this scc on the transmit clock. dcc?pll cs changed the carrier sense status as generated by the dpll has changed state. the real-time sta- tus may be found in sccs. this is not the cd pin status, which is reported elsewhere, and is only valid when the dpll is used. gra?raceful stop complete a graceful stop, which was initiated by the graceful stop transmit command, is now complete. this bit is set as soon the transmitter has finished transmitting any frame that was in progress when the command was issued. it will be set immediately if no frame was in progress when the command was issued. txe?x error an error (cts lost or underrun) occurred on the transmitter channel. rch?eceive character a byte or long word has been received and written to the buffer. this depends on the set- ting of the rfw bit in the gsmr. bsy?usy condition a byte/long-word was received and discarded due to lack of buffers. the receiver will re- sume reception after an enter hunt mode command. 1514131211109876543210 glr glt dcc gra txe rch bsy tx rx
serial communication controllers (sccs) motorola mc68360 user? manual 7-233 tx?x buffer a buffer has been transmitted. this bit is set no sooner than when the last bit of the last byte of the buffer begins its transmission, assuming the l-bit of the tx bd is set. if the l- bit is not set, tx is set when the last byte of data is written to the transmit fifo. rx?x buffer a complete buffer has been received on the scc channel. this bit is set no sooner than two serial clocks after the last bit of the last byte in which the buffer is received on the rxd pin. 7.10.21.12 transparent mask register (sccm). the sccm is referred to as the transparent mask register when the scc is operating in transparent mode. it is a 16-bit read- write register that has the same bit format as the transparent event register. if a bit in the transparent mask register is a one, the corresponding interrupt in the event register will be enabled. if the bit is zero, the corresponding interrupt in the event register will be masked. this register is cleared upon reset. 7.10.21.13 scc status register (sccs). the sccs is an 8-bit read-only register that allows the user to monitor real-time status conditions on the rxd line. the real-time status of the cts and cd pins are part of the port c parallel i/o. cs?arrier sense (dpll) this bit shows the real-time carrier sense of the line as determined by the dpll, if it is used. 0 = the dpll does not sense a carrier. 1 = the dpll does sense a carrier. 7.10.21.14 scc transparent example. the following list is an initialization se- quence for an scc transparent channel. the transmitter and receiver are both enabled, but operate independently of each other; they implement the connection shown on quicc 2 in figure 7-64. both transmit and receive clocks are provided externally to quicc 2 using the clk7 pin. scc4 is used. the transparent controller is configured with the rts4 and cd4 pins active. cts4 is grounded internally by the configuration in port c. a 16-bit crc-ccitt is sent with each transparent frame. the fifos are configured for fast operation. 1. the sdcr (sdma configuration register) should be initialized to $0740, rather than being left at its default value of $0000. 2. configure the port a pins to enable the txd4 and rxd4 pins. write papar bits 6 and 7 with ones. write padir bits 6 and 7 with zeros. write paodr bits 6 and 7 with zeros. 3. configure the port c pins to enable rts4 , cts4 , and cd4 . write pcpar bit 3 with one and bit 11 with zero. write pcdir bits 3 and 11 with zero. write pcso bit 11 with one and bit 10 with zero. 4. configure port a to enable the clk7 pin. write papar bit 14 with a one. write 76543210 cs
serial communication controllers (sccs) 7-234 mc68360 user? manual motorola padir bit 14 with a zero. 5. connect the clk7 pin to scc4 using the si. write the r4cs bits in sicr to 110. write the t4cs bits in sicr to 110. 6. connect the scc4 to the nmsi (i.e., its own set of pins). clear the sc4 bit in the sicr. 7. write $0740 to the sdcr to initialize the sdma configuration register. 8. write rbase and tbase in the scc parameter ram to point to the rx bd and tx bd in the dual-port ram. assuming one rx bd at the beginning of dual-port ram, and one tx bd following that rx bd, write rbase with $0000 and tbase with $0008. 9. program the cr to execute the init rx & tx params command for this channel. for instance, to execute this command for scc1, write $0001 to the cr. this com- mand causes the rbptr and tbptr parameters of the serial channel to be updated with the new values just programmed into rbase and tbase. 10. write rfcr with $18 and tfcr with $18 for normal operation. 11. write mrblr with the maximum number of bytes per receive buffer. for this case, assume 16 bytes, so mrblr = $0010. 12. write crc_p with $0000ffff to comply with the 16-bit crc-ccitt. 13. write crc_c with $0000f0b8 to comply with the 16-bit crc-ccitt. 14. initialize the rx bd. assume the rx data buffer is at $00001000 in main memory. write $b000 to rx_bd_status. write $0000 to rx_bd_length (not required?one for instructional purposes only). write $00001000 to rx_bd_pointer. 15. initialize the tx bd. assume the tx data buffer is at $00002000 in main memory and contains five 8-bit characters. write $bc00 to tx_bd_status. write $0005 to tx_bd_length. write $00002000 to tx_bd_pointer. 16. write $ffff to the scce to clear any previous events. 17. write $0013 to the sccm to enable the txe, tx, and rx interrupts. 18. write $08000000 to the cimr to allow scc4 to generate a system interrupt. (the cicr should also be initialized.) 19. write $00001980 to gsmr_h4 to configure the transparent channel. 20. write $00000000 to gsmr_l4 to configure the cts and cd pins to automatically control transmission and reception (diag bits). normal operation of the transmit clock is used (tci is cleared). notice that the transmitter (ent) and receiver (enr) have not been enabled yet. 21. write $00000030 to gsmr_l4 to enable the scc4 transmitter and receiver. this additional write ensures that the ent and enr bits will be enabled last. note after 5 bytes have been transmitted, the tx bd is closed. addi- tionally, the receive buffer is closed after 16 bytes have been re- ceived. any additional receive data beyond 16 bytes will cause
serial communication controllers (sccs) motorola mc68360 user? manual 7-235 a busy (out-of-buffers) condition since only one rx bd was pre- pared. 7.10.22 ram microcodes additional protocols may be added in the future through the use of ram microcodes. see appendix c risc microcode from ram for more information. 7.10.23 ethernet controller the ethernet/ieee 802.3 protocol is a widely used lan that is based on the carrier sense multiple access/collision detect (csma/cd) approach. ethernet and ieee 802.3 frames are very similar and can co-exist on the same lan. the two protocols are referred to synony- mously as "ethernet" in this manual unless specifically noted. ethernet/ieee 802.3 frames are based on the frame structure shown in figure 7-65. figure 7-65. ethernet/802.3 frame format; the frame begins with a 7-byte preamble of alternating ones and zeros. since the frame is manchester encoded, the preamble gives receiving stations a known pattern on which to lock. the start frame delimiter, which signifies the beginning of the frame, follows the pre- amble. the 48-bit destination address is next, followed by the 48-bit source address. origi- nal versions of the ieee 802.3 specification allowed 16-bit addressing; however, this addressing has never been significantly used in the industry. the next field is the type field in ethernet and the length field in ieee 802.3. the type field is used to signify the protocol used in the rest of the frame (e.g., tcp/ip). the length field is used to specify the length of the data portion of the frame. for ethernet and ieee 802.3 frames to co-exist on the same lan, the length field of the frame must always be unique from any type fields used in ethernet. this has limited the length of the data portion of the frame to 1500 bytes, and therefore the total frame length to 1518 bytes. the final 4 bytes of the frame are the fcs. this is the standard 32-bit ccitt-crc polyno- mial used in many other protocols. when a station wishes to transmit, it checks for activity on the lan. when the lan becomes silent for a specified period, the station begins transmission. during transmission, the station continually checks for collision on the lan. if a collision is detected, the station forces a jam of all ones on its frame and ceases transmission. collisions usually occur close to the begin- ning of a frame. the station then waits a random period of time (backoff) before attempting to transmit again. once the backoff is complete, the station waits for silence on the lan and preamble frame check sequence start frame delimiter data 7 bytes 1 byte 46?500 bytes dest. addr. source addr. 6 bytes 2 bytes type/ length 6 bytes 4 bytes frame length is 64?518 bytes note: the lsb of each octet is transmitted first.
serial communication controllers (sccs) 7-236 mc68360 user? manual motorola then begins retransmission on the lan, called a retry. if the frame is not successfully trans- mitted within 15 retries, then an error is indicated. a few key ethernet timing parameters are as follows. the ethernet of 10 mbps gives 0.8 m s per byte. the preamble plus start frame delimiter is transmitted in 6.4 m s. the minimum inter- frame gap is 9.6 m s. the slot time is 52 m s. 7.10.23.1 ethernet on quicc?c68en360. the ethernet protocol is available only on the ethernet version of the quicc, called the mc68en360. the non-ethernet version of the quicc is the mc68360. the term "quicc" is the overall device name that denotes all versions of the device. the mc68en360 is a superset of the mc68360, having the additional option allowing ether- net operation on any of the four sccs. due to performance reason not all sccs can be con- figured as ethernet controller at the same time. the mc68en360 is not restricted only to ethernet operation. hdlc, uart, and other protocols may be used to allow dynamic switching between protocols. see appendix a serial performance for available scc perfor- mance. when the mode bits of the scc gsmr select the ethernet protocol, then that scc per- forms the full set of ieee 802.3/ethernet csma/cd media access control and channel inter- face functions (see figure 7-66). the quicc ethernet controller requires an external serial interface adaptor (sia) and trans- ceiver function to complete the interface to the media. this function is implemented in the motorola mc68160 enhanced ethernet serial transceiver (eest). the quicc+eest solution provides a direct connection to the attachment unit interface (aui) or twisted-pair (10base-t). the eest provides a glueless interface to the quicc, manchester encoding and decoding, automatic selection of 10base-t versus aui ports, 10base-t polarity detection and correction, led drivers, and a low-power mode. for more information, refer to the mc68160 device description. the quicc ethernet controller provides a number of features listed below. although the quicc contains dplls that allow manchester encoding and decoding, these dplls were not designed for ethernet rates. therefore, the ethernet controller on the quicc bypasses the on-chip dplls and uses the external sia on the eest instead.
serial communication controllers (sccs) motorola mc68360 user? manual 7-237 figure 7-66. ethernet block diagram 7.10.23.2 ethernet key features. the ethernet contains the following key features: performs mac layer functions of ethernet and ieee 802.3 performs framing functions ?reamble generation and stripping ?estination address checking ?c generation and checking ?utomatic ?hort frames?padding on transmit ?raming error (dribbling bits) handling full collision support ?nforces the collision (jamming) ?runcated binary exponential backoff algorithm for random wait ?wo nonaggressive backoff modes ?utomatic frame retransmission (until ?ttempt limit?is reached) ?utomatic discard of incoming collided frames ?elay transmission of new frames for specified interframe gap bit rates up to 10 mbps receives back-to-back frames detection of receive frames that are too long multibuffer data structure supports 48-bit addresses in three modes: imb control registers clock generator peripheral bus receiver control unit receive data fifo transmitter control unit transmit data fifo shifter shifter txd internal clocks rxd random no. slot time and defer counter rx clock tx clock rts = tena cd = rena cts = clsn rrjct rstrt cd = rena cts = clsn
serial communication controllers (sccs) 7-238 mc68360 user? manual motorola ?hysical?ne 48-bit address recognized or 64-bin hash table for physical ad- dresses ?ogical?4-bin group address hash table plus broadcast address checking ?romiscuous?eceives all addresses, but discards frame if reject pin asserted external cam support on both serial and system bus interfaces up to eight parallel i/o pins may be sampled and appended to any frame heartbeat indication transmitter network management and diagnostics ?ost carrier sense ?nderrun ?umber of collisions exceeded the maximum allowed ?umber of retries per frame ?eferred frame indication ?ate collision receiver network management and diagnostics ?rc error indication ?onoctet alignment error ?rame too short ?rame too long ?verrun ?usy (out of buffers) error counters ?iscarded frames (out of buffers or overrun occurred) ?rc errors ?lignment errors internal and external loopback mode 7.10.23.3 learning ethernet on the quicc. the following paragraphs detail the ethernet functionality on the quicc. however, they show the additions made to the stan- dard scc functionality to implement ethernet. therefore, the reader is encouraged to learn the basics of the sccs and the overall architecture of the cpm before attempting to learn this section in great detail. a first-time user of the quicc who plans to use ethernet on the quicc should first read the following sections of this user manual. 1. 7.1 risc controller , 7.2 command set, and 7.3 dual-port ram. the risc controller is used to issue special commands to the ethernet channel. the dual-port ram is used to load ethernet parameters and initialize bds for use by the ethernet channel. 2. 7.7 sdma channels discusses how sdma channels are used to transfer data to/from the ethernet channel and system memory. 3. 7.8.9 nmsi configuration explains how clocks are routed to the sccs through the bank of clocks. 4. 7.10.1 scc overview contains more detailed information on the sccs that are appli-
serial communication controllers (sccs) motorola mc68360 user? manual 7-239 cable to all protocols. the reader does not need to read the scc dpll description since the on-chip dplls are not used in ethernet. 5. 7.10.23 ethernet controller should be read next. 6. 7.15 cpm interrupt controller (cpic) defines the interrupt priority of this scc and how interrupts are generated to the cpu32+ core. 7. 7.14 parallel i/o ports shows how to configure the desired ethernet pin functions to be active. 7.10.23.4 connecting quicc to ethernet. figure 7-67 shows the basic compo- nents and pins required to make the ethernet connection between the quicc and the eest. the quicc ethernet controller has seven basic pins that make up the interface to the ex- ternal eest chip: 1. receive clock. receive clock to the scc (rclk) may be either the clk1, clk2, clk3, or clk4 pin that is routed through the bank of clocks on the quicc. 2. transmit clock. transmit clock to the scc (tclk) may be either the clk1, clk2, clk3, or clk4 pin that is routed through the bank of clocks on the quicc. (the scc rclk and scc tclk should not be connected to the same clkx pin since the eest provides a separate receive and transmit clock signal). 3. transmit data. this is the quicc the txd pin. 4. receive data. this is the quicc rxd pin.
serial communication controllers (sccs) 7-240 mc68360 user? manual motorola figure 7-67. connecting the quicc to ethernet the following pins take on new meanings when the ethernet protocol is selected for the scc: 1. transmit enable (tena). the scc? rts pin changes to become tena when the scc is configured for ethernet operation. the polarity of tena is active high; where- as, the polarity of rts is active low. 2. receive enable (rena). the scc? cd pin changes to become rena when the scc is configured for ethernet operation. the polarity of rena is active high; whereas, the polarity of cd is active low. 3. collision (clsn). the scc? cts pin changes to become clsn when the scc is configured for ethernet operation. the polarity of clsn is active high; whereas, the polarity of cts is active low. note the carrier sense signal is often referred to in ethernet descrip- tions, because it defines whether the lan is currently in use. carrier sense is defined as rena ored with clsn. the eest has similar names for its connection to the seven basic quicc pins. in addition, the eest contains a loopback pin to allow the quicc to perform external loopback testing. this can be controlled by any available parallel i/o pin on the quicc. quicc rj-45 scc txd tena (rts) tclk (clkx) rxd rena (cd) rclk (clkx) clsn (cts) parallel i/o tx tena tclk rx rena rclk clsn loop d-15 twisted pair aui passive passive eest mc68160 preamble frame check sequence start frame delimiter data 7 bytes 1 byte 46?500 bytes dest. addr. source addr. 6 bytes 2 bytes type/ length 6 bytes 4 bytes stored in transmit buffer stored in receive buffer note: short transmit frames are padded automatically by the quicc.
serial communication controllers (sccs) motorola mc68360 user? manual 7-241 in addition, the quicc has additional pins used to interface to an optional external content- addressable memory (cam). these pins are described in 7.10.23.7 cam interface. external to the eest are the passive components (principally transformers) required to con- nect to aui or twisted-pair media. for more information on the eest connection circuits, refer to the mc68160 device description. the quicc stores every byte received after the start frame delimiter into system memory, using the sdma channels. on transmit, the user provides the destination address, source address, type/length field, and the transmit data. the quicc will automatically pad frames that have less than 46 bytes in the data field to meet the minimum frame requirements. in addition, the quicc will append the fcs to the frame. 7.10.23.5 ethernet channel frame transmission. the ethernet transmitter is designed to work with almost no intervention from the host. when the host enables the transmitter, the ethernet controller will poll the first tx bd in the channel? tx bd table. the poll occurs every 128 serial clocks. if the user has a frame ready to transmit, the tod bit in the transmit-on-demand register may be set to eliminate waiting for the next poll to occur. when there is a frame to transmit, the ethernet controller will begin fetching the data from the data buffer, assert tena to the eest, and start transmitting the preamble sequence, the start frame delimiter, and then the frame information. however, the controller will defer the transmission if the line is busy (carrier sense is active). before transmitting, the controller waits for carrier sense to become inactive. once carrier sense becomes inactive, the con- troller determines if carrier sense stays inactive for 6.0 m s. if so, then the transmission will begin after waiting an additional 3.6 m s (i.e., 9.6 m s after carrier sense originally became inactive). if a collision occurs during the transmit frame, the ethernet controller follows the specified backoff procedures and attempts to retransmit the frame until the retry limit threshold is reached. the ethernet controller stores the first 5 to 8 bytes of the transmit frame (8 bytes if the transmit frame was long-word aligned) in internal ram, so that they do not have to be retrieved from system memory in case of a collision. this improves bus utilization and latency in the case that the backoff timer output results in a need for an immediate retrans- mission. if a collision occurs during the transmission of the frame, the ethernet controller will return to the first buffer for a retransmission. the only restriction is that the first buffer should contain at least 9 bytes. when the end of the current bd has been reached and the l-bit in the tx bd is set, the fcs (32-bit crc) bytes are appended (if the tc bit is set in the tx bd), and tena is negated. this tells the eest to generate the illegal manchester encoding that signifies the end of the ethernet frame. following the transmission of the crc, the ethernet controller writes the frame status bits into the bd and clears the r-bit. when the end of the current bd has been reached, and the l-bit is not set (i.e., a frame is comprised of multiple buffers), only the r-bit is cleared.
serial communication controllers (sccs) 7-242 mc68360 user? manual motorola in either mode, an interrupt can be issued according to the i-bit in the tx bd. the ethernet controller will then proceed to the next tx bd in the table. in this way, the user may be inter- rupted after each frame, after each buffer, or after a specific buffer has been transmitted. the ethernet controller has an option to add pad characters to short frames. if the pad bit is set in the tx bd, the frame will be padded up to the value of the minimum frame length register. to rearrange the transmit queue before the cp has completed transmission of all frames, issue the graceful stop transmit command. this technique can be useful for trans- mitting expedited data before previously linked buffers or for error situations. when the graceful stop transmit command is issued, the ethernet controller will stop imme- diately if no transmission is in progress, or continue transmission until the current frame has successfully completed transmission or terminates with a collision. when the ethernet con- troller is given the restart transmit command, it resumes transmission. the ethernet controller transmits bytes lsb first. 7.10.23.6 ethernet channel frame reception. the ethernet receiver is also designed to work with almost no intervention from the host. the ethernet receiver can per- form address recognition, crc checking, short frame checking, maximum dma transfer checking, and maximum frame length checking. when the host enables the ethernet receiver, it will enter hunt mode as soon as the rena signal is asserted if clsn is negated. in hunt mode, as data is shifted into the receive shift register one bit at a time, the contents of the register are compared to the contents of the syn1 field in the data synchronization register. this compare function becomes valid a cer- tain number of clocks after the start of the frame (depending on the nib bits in the psmr). if the two are not equal, the next bit is shifted in, and the comparison is repeated. if a double zero fault or double one fault is detected between bits 14 to 21 from the start of the frame, the frame is rejected. if a double zero fault is detected after 21 bits from the start of the frame and before detection the start frame delimiter, the frame is also rejected. when the registers match, the hunt mode is terminated, and character assembly begins. when the receiver detects the first bytes of the frame, the ethernet controller will perform address recognition functions on the frame (see 7.10.23.11 ethernet address recognition). the receiver can receive physical (individual), group (multicast), and broadcast addresses. no ethernet receive frame data is written to memory until the internal address recognition algorithm is complete, which improves bus utilization in the case of frames not addressed to this station. the receiver can also work with an external cam. see 7.10.23.7 cam interface for more details. in the case of an external cam, frame reception continues normally unless the cam specifically signals the frame to be rejected. if a match is detected, the ethernet controller will fetch the next rx bd and, if it is empty, will start to transfer the incoming frame to the rx bd? associated data buffer. if a collision is detected during the frame, the rx bds associated with this frame are reused. thus, no col-
serial communication controllers (sccs) motorola mc68360 user? manual 7-243 lision frames are presented to the user except late collisions, which indicate serious lan problems. when the data buffer has been filled, the ethernet controller clears the e-bit in the rx bd and generates an interrupt if the i-bit is set. if the incoming frame exceeds the length of the data buffer, the ethernet controller will fetch the next rx bd in the table and, if it is empty, will continue to transfer the rest of the frame to this bd? associated data buffer. the rx bd length is determined in the mrblr value in the scc general-purpose parameter ram. the user should program mrblr to be at least 64 bytes. during reception, the ethernet controller will check for a frame that is too short or too long. when the frame ends (carrier sense is negated), the receive crc field is checked and writ- ten to the data buffer. the data length written to the last bd in the ethernet frame is the length of the entire frame. this enables software to correctly recognize the frame-too-long condition. when the receive frame is complete, the ethernet controller has the option to sample one byte from the port b parallel i/o (pb15?b8) and append this byte to the end of the last rx bd in the frame. for any of the pb15?b8 pins that are defined as outputs, the contents of the pbdat latch is read, rather than the pin itself. although this capability is useful for cam applications, it may be used whether or not an external cam is present. the sampling occurs at the end of frame reception. the ethernet controller then sets the l-bit in the rx bd, writes the other frame status bits into the rx bd, and clears the e-bit. the ethernet controller next generates a maskable interrupt, indicating that a frame has been received and is in memory. the ethernet control- ler then waits for a new frame. the ethernet controller receives serial data lsb first. 7.10.23.7 cam interface. the ethernet controller has two options for connecting to an external cam: a serial interface option and a system bus interface option. actually, both options may be used at once (there is no mode bit to select them); however, they are described independently for clarity. to implement an option, the user only needs to enable the particular pins that are desirable. both options use a reject pin on the quicc to signify that the current frame is to be dis- carded. the quicc internal address recognition logic may be used in combination with an external cam. see 7.10.23.11 ethernet address recognition for more details. the serial interface option is shown in figure 7-66. the quicc outputs a receive start (rstrt) signal when the start frame delimiter is recognized. the rstrt signal is asserted for just one bit time on the second destination address bit.
serial communication controllers (sccs) 7-244 mc68360 user? manual motorola figure 7-68. quicc ethernet serial cam interface the cam control logic uses rstrt , in combination with the rxd and rclk signals, to store the destination address, source address, etc. and generate writes to the cam for address recognition. in addition, the rena signal supplied from the eest may be used to abort the comparison if a collision occurs on the receive frame. after the comparison occurs, the cam control logic asserts the receive reject (rrjct ) pin, if the current receive frame should be rejected. the quicc ethernet controller will then immediately stop writing data to system memory and will reuse the buffer(s) for the next frame. if the cam wishes to accept the frame, the cam control logic does nothing (rrjct is not asserted). if rrjct is asserted, it must be asserted prior to the end of the receive frame. quicc scc tena (rts) tclk (clkx) rxd rena (cd) rclk (clkx) clsn (cts) rstrt rrjct parallel i/o tx tena tclk rx rena rclk clsn loop passive eest mc68160 to media shift register and cam control cam buffers note: the receive data is sent directly from the eest serial interface to the cam using rxd and rclk. rstrt is asserted at the beginning of the destination address. rrjct should be asserted during the frame to cause the frame to be rejected. the system bus is used for cam initialization and maintenance. system bus preamble frame check sequence start frame delimiter 7 bytes 46?500 bytes dest. addr. source addr. 6 bytes 2 bytes type/ length 6 bytes rstrt rrjct rxd frame rejected if asserted during frame reception. further transmissions on system bus cease, and buffer descriptors are reused. pb15?b8 data optional frame tag byte asserted on second destination address bit for a duration of one bit time. sdack2?dack1 1 byte 4 bytes txd
serial communication controllers (sccs) motorola mc68360 user? manual 7-245 additionally, the cam control logic may wish to provide additional information on the pb15 pb8 pins. the quicc ethernet controller will write this additional byte to memory during the last sdma write if the sip bit is set in the psmr. this information tag is sampled by the quicc ethernet controller as the last fcs byte is read from the receive fifo. the informa- tion tag should be provided by the cam control logic no later than when rena is negated at the end of a non-collision frame, and should be held stable on the pb15?b8 pins until the sdack2 ?dack1 pins signal that the tag byte is being written to memory. the parallel interface option is shown in figure 7-69. the quicc outputs two signals every time it writes ethernet frame data to system memory. the signals sdma acknowledge (sdack2 ?dack1 ), are asserted during all bus cycles on which ethernet frame data is written to memory. (these signals are not used for other protocols.) the cam control logic uses these pins to enable the cam writes simultaneously with system memory writes. in this way, the cam captures the frame data at the same time that it is being written to system memory. the chief advantage of this approach is that the data is already in parallel form when it leaves the quicc. the sdack2 ?dack1 signals are asserted during all bus cycles writes of the frame data. a certain sdack2 ?dack1 combination specifically identifies the first 32-bits of the frame, another identifies all mid-frame data, and a third combination identifies the last 32-bit bus write of the frame (only if the tag byte is appended). the tag byte is appended from the sam- ple of pb15?b8 if the sip bit is set in the psmr. the tag byte will always be in byte 3 of the last 32-bit write. the rx bd data length does not include tag byte in the length calcu- lation. if the system memory is 32 bits, then the quicc 32-bit write will take one bus cycle. if the system memory is 16 bits or 8 bits, then the quicc 32-bit write will take two or four bus cycles. in any case, the sdack2 ?dack1 signals are valid on each bus cycle of a 32-bit write cycle and only during bus cycles associated with the ethernet receiver. additionally, the user may choose a unique function code (fc3?c0) associated with the sdma receive channel associated with the ethernet scc to have an alternate method of identifying accesses from this scc. note the tag byte is always written to byte 3 of the last sdma write to the buffer, and is not necessarily appended to the last byte of the frame. the rx bd data length does not show the length of the tag byte in the frame. also the sdack2-1 signals will equal "00" whenever the frame length is not an even multiple of 4 (i.e., it does not depend on whether the tag byte is appended).
serial communication controllers (sccs) 7-246 mc68360 user? manual motorola figure 7-69. quicc ethernet parallel cam interface ; 7.10.23.8 ethernet memory map. when configured to operate in ethernet mode, the quicc overlays the structure described in table 7-5 onto the protocol-specific area of the scc parameter ram described in table 7-11. quicc scc txd tena (rts) tclk (clkx) rxd rena (cd) rclk (clkx) clsn (cts) rstrt rrjct parallel i/o tx tena tclk rx rena rclk clsn loop passive eest mc68160 to media cam control cam note: the receive data is sent to the cam as it is written to system memory. the sdack2?dack1 signals are used to identify the destination address and any other frame bytes desired. the rstrt signal is not required in this configuration, although it is still available. system bus sdack2?dack1 data 46?500 bytes dest. addr. source addr. 4 bytes 2 bytes 6 bytes sdack2 sdack1 rrjct frame can be rejected if asserted during frame reception. further transmissions on system bus cease, and buffer descriptors are reused. sdack1 asserted when new frame arrives. sdma bus writes dest. addr. 2 bytes signifies last 32-bit bus write to memory only if tag byte is appended. tag byte could be byte 0, 1, 2, or 3 of the 32-bit write. asserted for one cycle or two 16-bit bus write cycles, etc. pb15?b8 optional frame tag byte tag 1 byte (optional) asserted on each write cycle to memory up to and including the last system bus write of the frame note: the diagram shows sdma system bus writes, not data on the rxd pin. other bus activity may occur between successive 32-bit writes. in such a case, the sdack2? pins would not be asserted for other bus activity. type/ length frame check sequence 4 bytes
serial communication controllers (sccs) motorola mc68360 user? manual 7-247 table 7-11. ethernet-specific parameters address name width description user writes scc base + 30 c_pres long preset crc $ffffffff scc base + 34 c_mask long constant mask for crc $debb20e3 scc base + 38 crcec long crc error counter scc base + 3c alec long alignment error counter scc base + 40 disfc long discard frame counter scc base + 44 pads word short frame pad character scc base + 46 ret_lim word retry limit threshold 15 dec scc base + 48 ret_cnt word retry limit counter scc base + 4a mflr word maximum frame length register 1518 dec scc base + 4c minflr word minimum frame length register 64 dec scc base + 4e maxd1 word max dma1 length register 1518 dec scc base + 50 maxd2 word max dma2 length register 1518 dec scc base + 52 maxd word rx max dma scc base + 54 dma_cnt word rx dma counter scc base + 56 max_b word max bd byte count scc base + 58 gaddr1 word group address filter 1 scc base + 5a gaddr2 word group address filter 2 scc base + 5c gaddr3 word group address filter 3 scc base + 5e gaddr4 word group address filter 4 scc base + 60 tbuf0.data0 long save area 0 - current frame scc base + 64 tbuf0.data1 long save area 1 - current frame scc base + 68 tbuf0.rba0 long scc base + 6c tbuf0.crc long scc base + 70 tbuf0.bcnt word scc base + 72 paddr1_l word physical address 1 (lsb) scc base + 74 paddr1_m word physical address 1 scc base + 76 paddr1_h word physical address 1 (msb) 2 scc base + 78 p_per word persistence scc base + 7a rfbd_ptr word rx first bd pointer scc base + 7c tfbd_ptr word tx first bd pointer scc base + 7e tlbd_ptr word tx last bd pointer scc base + 80 tbuf1.data0 long save area 0 - next frame scc base + 84 tbuf1.data1 long save area 1 - next frame scc base + 88 tbuf1.rba0 long scc base + 8c tbuf1.crc long scc base + 90 tbuf1.bcnt word scc base + 92 tx_len word tx frame length counter scc base + 94 iaddr1 word individual address filter 1 scc base + 96 iaddr2 word individual address filter 2 scc base + 98 iaddr3 word individual address filter 3 scc base + 9a iaddr4 word individual address filter 4 scc base + 9c boff_cnt word backoff counter
serial communication controllers (sccs) 7-248 mc68360 user? manual motorola note: 1. the boldfaced items should be initialized by the user. 2. the address should be wrtten in little endian, not motorola big endian format (i.e., physical address 112233445566 should be written paddr1_l= 6655, paddr1_m=4433, paddr1_h=2211. c_pres. for the 32-bit crc-ccitt, c_pres should be initialized with $ffffffff. c_mask. for the 32-bit crc-ccitt, c_mask sh ould be initialized with $debb20e3. crcec, alec, and disfc. these 32-bit (modulo 2 32 ) counters are maintained by the cp. they may be initialized by the user while the channel is disabled. crcec is incremented for each received frame with a crc error, except it does not includes frames not addressed to the user, frames received in the out-of-buffers condition, frames with overrun errors, or frames with alignment errors. alec is incremented for frames received with dribbling bits, but does not includes frames not addressed to the user, frames received in the out-of-buff- ers condition, or frames with overrun errors. disfc is incremented for frames discarded because of the out-of-buffers condition or an overrun error. the crc does not have to be correct for this counter to be incremented. pads. into this 16-bit register the user writes the pattern of the pad characters that should be sent when short frame padding is implemented. the byte pattern written to the register may be any value, but both the high and low bytes should be the same. ret_lim. the user writes the number of retries that should be made to transmit a frame into this 16-bit register. this value is typically 15 decimal. if the frame is not transmitted after this limit is reached, an interrupt may be generated. ret_cnt is a temporary down-counter used to count the number of retries made. mflr. the ethernet controller checks the length of an incoming ethernet frame against the user-defined value given in this 16-bit register. typically this register is set to 1518 decimal. if this limit is exceeded, the remainder of the incoming frame is discarded, and the lg (rx frame too long) bit is set in the last rx bd belonging to that frame. the ethernet controller will report the frame status and the frame length in the last rx bd. mflr is defined as all the in-frame bytes between the start frame delimiter and the end of the frame (destination address, source address, length, llc data, pad, and fcs). dma_cnt is a temporary down-counter used to track the frame length. minflr. the ethernet controller checks the length of an incoming ethernet frame against the user-defined value given in this 16-bit register. typically this register is set to 64 decimal. if the received frame length is less than the register value, then this frame is discarded unless the rsh (receive short frames) bit in the psmr is set. if rsh is set, then the sh (rx frame too short) bit is set in the last rx bd belonging to that frame. for transmit operation, if the frame is too short, the ethernet controller will add pads to the transmitted frame scc base + 9e taddr_l word temp address (lsb) scc base + a0 taddr_m word temp address scc base + a2 taddr_h word temp address (msb) 2 table 7-11. ethernet-specific parameters
serial communication controllers (sccs) motorola mc68360 user? manual 7-249 (according to the pad bit in the tx bd and the pad value in the parameter ram). pads will be added to make the transmit frame minflr bytes in length. maxd1. this parameter gives the user the ability to stop system bus writes from occurring after a frame has exceeded a certain size. the value of this register is valid only if an address match was detected. the ethernet controller checks the length of an incoming ethernet frame against the user-defined value given in this 16-bit register. typically, this reg- ister is set to 1518 decimal. if this limit is exceeded, the remainder of the incoming frame is discarded. the ethernet controller waits to the end of the frame (or until mflr bytes have been received) and reports the frame status and the frame length in the last rx bd. maxd2. this parameter gives the user the ability to stop system bus writes from occurring after a frame has exceeded a certain size. the value of this register is valid in promiscuous mode when no address match was detected. the ethernet controller checks the length of an incoming ethernet frame against the user-defined value given in this 16-bit register. typ- ically, this register is set to 1518 decimal. if this limit is exceeded, the remainder of the incoming frame is discarded. the ethernet controller waits to the end of the frame (or until mflr bytes have been received) and reports the frame status and the frame length in the last rx bd. in a monitor station, maxd2 can be programmed to a value much less than maxd1 to receive entire frames addressed to this station, but receive only the headers of all other frames. gaddr1?. these four registers are used in the hash table function of the group address- ing mode. the user may write zeros to these values after reset and before the ethernet channel is enabled to disable all group hash address recognition functions. the set group address command is used to enable the hash table. paddr1. the user writes the 48-bit individual address of this station into this location. paddr1_l is the lowest order word, and paddr1_h is the highest order word. p_per . this parameter allows the ethernet controller to be less aggressive in its behavior following a collision. normally, this parameter should be set to $0000. to decrease the aggressiveness of the ethernet controller, p_per can be set to a value from 1 to 9, with 9 being the least aggressive. the p_per value is added to the retry count in the backoff algo- rithm to reduce the probability of transmission on the next time slot. note the use of p_per is fully allowed within ethernet/802.3 specifi- cations. in a heavily congested ethernet lan, a less aggressive backoff algorithm used by multiple stations on the lan increas- es the overall lan throughput by reducing the probability of col- lisions. the sbt bit in the psmr offers another way to reduce the ag- gressiveness of the ethernet controller.
serial communication controllers (sccs) 7-250 mc68360 user? manual motorola iaddr1?. these four registers are used in the hash table function of the individual addressing mode. the user may write zeros to these values after reset and before the ether- net channel is enabled to disable all individual hash address recognition functions. the set group address command is used to enable the hash table. taddr. this parameter allows the user to add and delete addresses from the individual and group hash tables. after placing an address in taddr, the user would then issue the set group address command. taddr_l is the lowest order word, and taddr_h is the highest order word. 7.10.23.9 ethernet programming model. the host configures scc to operate as an ethernet controller by the mode bits in the gsmr. the receive errors (collision, overrun, nonoctet aligned frame, short frame, frame too long, and crc error) are reported through the rx bd. the transmit errors (underrun, heartbeat, late collision, retransmission limit, and carrier sense lost) are reported through the tx bd. several bit fields in the gsmr must be programmed to special values for ethernet. see the gsmr for more details. the user should program the dsr as shown below. the 6 bytes of preamble programmed in the gsmr, in combination with the programming of the dsr shown below, causes 8 bytes of preamble on transmit (including the 1-byte start delimiter with the value $d5). 7.10.23.10 ethernet command set. ethernet:ethernet command setthe following transmit and receive commands are issued to the cr. note before issuing the cp reset command, configure the tena (rts ) pin to be an input. see step 3 of 7.10.23.23 scc ethernet example. for more information. 7.10.23.10.1 transmit commands. the following paragraphs describe the ethernet trans- mit commands. stop transmit command . when used with the ethernet controller, this command vio- lates specified behavior of an ethernet/ieee 802.3 station. it should not be used. graceful stop transmit command . the channel graceful stop transmit command is used to stop transmission in an orderly way. it stops transmission after the cur- rent frame has completed transmission or undergoes a collision (immediately if there is no frame being transmitted). the gra bit in the scce will be set once transmission has stopped. after transmission ceases, the ethernet transmit parameters, including bds, may be modified by the user. the tbptr will point to the next tx bd in the table. transmission will begin once the r-bit of the next bd is set and the restart transmit command is issued. 1514131211109876543210 syn2 = $d5 syn1 = $55
serial communication controllers (sccs) motorola mc68360 user? manual 7-251 note if the graceful stop transmit command is issued and the current transmit frame ends in a collision, the tbptr will point to the beginning of the collided frame, with the r-bit still set in the tx bd (i.e., the frame will look as if it were never transmit- ted). restart transmit command . the restart transmit command enables the trans- mission of characters on the transmit channel. this command is expected by the ethernet controller after a graceful stop transmit command or after a transmitter error (underrun, retransmission limit reached, or late collision). the ethernet controller will resume transmission from the current tbptr in the channel? tx bd table. init tx parameters command . this command initializes all the transmit parameters in this serial channel? parameter ram to their reset state. this command should only be issued when the transmitter is disabled. note that the init tx and rx parameters com- mand may also be used to reset both transmit and receive parameters. 7.10.23.10.2 receive commands. the following paragraphs describe the ethernet receive commands. enter hunt mode command . after a hardware or software reset and the enabling of the channel in the scc mode register, the channel is in the receive enable mode and will use the first bd in the table. the enter hunt mode command is generally used to force the ethernet receiver to abort reception of the current frame and enter the hunt mode. in the hunt mode, the ethernet controller continually scans the input data stream for a transition of carrier sense from inac- tive to active and then a preamble sequence followed by the start frame delimiter. after receiving the command, the current receive buffer is closed, and the crc calculation is reset. further frame reception will use the next rx bd. close rx bd command . this command should not be used with the ethernet controller. i nit rx parameters command . this command initializes all the receive parameters in this serial channel? parameter ram to their reset state. this command should only be issued when the receiver is disabled. note that the init tx and rx parameters com- mand may also be used to reset both receive and transmit parameters. 7.10.23.10.3 set group address command. the set group address com- mand is used to set a bit in one of the 64 bits of the four individual/group address hash filter registers (gaddr1? or iaddr1?). the individual or group address (48 bits) to be added to the hash table should be written to taddr_l, taddr_m, and taddr_h in the param- eter ram prior to executing this command. the risc controller checks the i/g bit in the address stored in taddr to determine whether to use the individual hash table or the group hash table. a zero in the i/g bit implies an individual address, and a one in the i/g bit implies a group address.
serial communication controllers (sccs) 7-252 mc68360 user? manual motorola this command may be executed at any time, regardless of whether the ethernet channel is enabled. if an address from the hash table must be deleted, the ethernet channel should be disabled, the hash table registers should be cleared, and the set group address command must be executed for the remaining desired addresses. this is required because the hash table may have mapped multiple addresses to the same hash table bit. 7.10.23.11 ethernet address recognition. the ethernet controller can filter the received frames based on different addressing types: physical (referred to as individual), group (referred to as multicast), broadcast (an all-ones group address), and promiscuous. the difference between an individual address and a group address is determined by the i/ g bit in the destination address field. a flowchart for address recognition on received frames is shown in figure 7-70. in the physical type of address recognition, the ethernet controller will compare the destina- tion address field of the received frame with the physical address that the user programs in the paddr1. alternatively, the user may perform address recognition on multiple individual addresses using the iaddr1? hash table. see 7.10.23.12 hash table algorithm for more information. in the group type of address recognition, the ethernet controller will determine whether the group address is a broadcast address. if broadcast addresses are enabled, then the frame is accepted. if the group address is not a broadcast address, then the user may perform address recognition on multiple group addresses using the gaddr1? hash table. see 7.10.23.12 hash table algorithm for more information. in the promiscuous mode, the ethernet controller will receive all the incoming frames regard- less of their address, unless the rrjct pin is asserted. if an external cam is used for address recognition, then the user should select the promis- cuous mode, and the frame can be rejected by assertion of the rrjct pin during the recep- tion of the frame. the on-chip address recognition functions may be used in addition to the external cam address recognition functions. note if the external cam is used to store addresses that should be re- jected, rather than accepted, then the use of the rrjct pin by the cam should be logically inverted.
serial communication controllers (sccs) motorola mc68360 user? manual 7-253 figure 7-70. ethernet address recognition flowchart 7.10.23.12 hash table algorithm. the hash table process used in the individual and group hash filtering operates as follows. the ethernet controller maps any 48-bit address i/g address broadcast addr multiple ind g i broadcast enabled t f f t match ? hash search t match ? hash_search use indicated table t match ? t f t f f f t f use group table multiple individual addresses receive frame ignore rrjct pin check address receive frame ignore rrjct pin receive frame ignore rrjct pin single address promisc ? start receive discard frame if rrjct pin is asserted discard frame
serial communication controllers (sccs) 7-254 mc68360 user? manual motorola into one of 64 bins. the 64 bins are represented by 64 bits stored in gaddr1? or iaddr1 4. when the set group address command is executed, the ethernet controller maps the selected 48-bit address into one of the 64 bits. this is performed by passing the 48-bit address through the on-chip 32-bit crc generator and selecting 6 bits of the crc-encoded result to generate a number between 1 and 64. bits 31?0 of the crc result select one of the four gaddrs or iaddrs, and bits 29?6 of the crc result select the bit within the selected register. when a frame is received by the ethernet controller, the same process is used. if the crc generator selects a bit that is set in the group/individual hash table, the frame is accepted; otherwise, it is rejected. the result is that if eight group addresses are stored in the hash table, and random group addresses are received, the hash table prevents roughly 56/64 (or 87.5%) of the group address frames from reaching memory. those that do reach memory must be further filtered by the processor to determine if they truly contain one of the eight desired addresses. better performance is achieved by using the group hash table and individual hash table at the same time. for instance, if eight group and eight physical addresses are stored in their respective hash tables, 87.5% of all frames (not just group address frames) are prevented from reaching memory. the effectiveness of the hash table declines as the number of addresses increases. for instance, with 128 addresses stored in a 64-bin hash table, the vast majority of the hash table bits will be set, preventing only a small fraction of the frames from reaching memory. in such instances, an external cam is advised if the extra bus utilization cannot be tolerated. see 7.10.23.7 cam interface for more details. note the hash tables cannot be used to reject frames that match a set of entered addresses because unintended addresses will be mapped to the same bit in the hash table. thus, an external cam must be used to implement this function. 7.10.23.13 interpacket gap time. the minimum interpacket gap time for back-to- back transmission is 9.6 m s. the receiver can receive back-to-back frames with this mini- mum spacing. in addition, after the backoff algorithm, the transmitter will wait for carrier sense to be negated before retransmitting the frame. the retransmission will begin 9.6 m s after carrier sense is negated if carrier sense stays negated for at least 6.4 m s. 7.10.23.14 collision handling. if a collision occurs during frame transmission, the ethernet controller will continue the transmission for at least 32 bit times, transmitting a jam pattern consisting of 32 ones. if the collision occurs during the preamble sequence, the jam pattern will be sent after the end of the preamble sequence. if a collision occurs within 64 byte times, the retry process is initiated. the transmitter will wait a random number of slot times. a slot time is 512 bit times (52 m s). if collision occurs
serial communication controllers (sccs) motorola mc68360 user? manual 7-255 after 64 byte times, then no retransmission is performed, and the buffer is closed with an lc error indication. if a collision occurs during frame reception, the reception is stopped. this error will be reported in the bd only if the length of this frame is greater than or equal to the minflr or if the rsh mode is enabled in the psmr. 7.10.23.15 internal and external loopback. both internal and external loop- back are supported by the ethernet controller. in loopback mode, both of the scc fifos are used, and the channel actually operates in a full-duplex fashion. both internal and exter- nal loopback are configured using combinations of the lpb bit in the psmr and the diag bits in the gsmr. because of the full-duplex nature of the loopback operation, the perfor- mance of the other sccs will be degraded. internal loopback disconnects the scc from the si. the receive data is connected to the transmit data, and the receive clock is connected to the transmit clock. both fifos are used. the transmitted data from the transmit fifo is received immediately into the receive fifo. there is no heartbeat check in this mode. in this mode tena should be configured to be a general purpose output. (pcpar[0]=0, pcdir[0]=1, pcdat[0]=0) and the hbc bit in the psmr should be 0. in external loopback operation, the ethernet controller listens for receive data from the eest at the same time that it is transmitting. 7.10.23.16 ethernet error-handling procedure. the ethernet controller reports frame reception and transmission error conditions using the channel bds, the error counters, and the ethernet event register. 7.10.23.16.1 transmission errors. the following paragraphs describe various types of ethernet transmission errors. transmitter underrun . if this error occurs, the channel sends 32 bits that ensure a crc error, terminates buffer transmission, closes the buffer, sets the un bit in the tx bd, and sets txe in the ethernet event register. the channel will resume transmission after recep- tion of the restart transmit command. carrier sense lost during frame transmission . when this error occurs and no collision is detected in this frame, the channel sets the csl bit in the tx bd, sets txe in the ethernet event register, and continues the buffer transmission normally. no retries are performed as a result of this error. retransmission attempts limit expired . when this error occurs, the channel terminates buffer transmission, closes the buffer, sets the rl bit in the tx bd, and sets txe. the chan- nel will resume transmission after reception of the restart transmit command. late collision . when this error occurs, the channel terminates buffer transmission, closes the buffer, sets the lc bit in the tx bd, and sets txe. the channel will resume transmission after reception of the restart transmit command.
serial communication controllers (sccs) 7-256 mc68360 user? manual motorola note the definition of what constitutes a late collision is made in the lcw bit in the psmr. heartbeat . some transceivers have a self-test feature called ?eartbeat?or ?ignal quality error.?to signify a good self-test, the transceiver indicates a collision to the quicc within 20 clocks after completion of a frame transmitted by the ethernet controller. this indication of a collision does not imply a real collision error on the network, but is rather an indication that the transceiver still seems to be functioning properly. this is called the heartbeat con- dition. if the hbc bit is set in the ethernet mode register and the heartbeat condition is not detected by the quicc after a frame transmission, then a heartbeat error occurs. when this error occurs, the channel closes the buffer, sets the hb bit in the tx bd, and generates the txe interrupt if it is enabled. 7.10.23.16.2 reception errors. the following paragraphs describe various types of ether- net reception errors. overrun error . the ethernet controller maintains an internal fifo for receiving data. if a receiver fifo overrun occurs, the channel writes the received data byte to the internal fifo over the previously received byte. the previous data byte and the frame status are lost. the channel closes the buffer, sets the ov bit in the rx bd, sets rxf in the ethernet event reg- ister, and increments the discarded frame counter (disfc). the receiver then enters the hunt mode. busy error. a frame was received and discarded due to lack of buffers. the channel sets bsy in the ethernet event register and increments the discarded frame counter (disfc). nonoctet error (dribbling bits) . the ethernet controller can handle up to seven dribbling bits when the receive frame terminates nonoctet aligned. the ethernet controller checks the crc of the frame on the last octet boundary. if there is a crc error, then the frame nonoctet aligned (no) error is reported, the rxf bit is set, and the alignment error counter (alec) is incremented. if there is no crc error, then no error is reported. crc error . when a crc error occurs, the channel closes the buffer, sets the cr bit in the rx bd, and sets the rxf bit. the channel also increments the crc error counter (crcec). after receiving a frame with a crc error, the receiver enters hunt mode. crc checking can- not be disabled, but the crc error may be ignored if checking is not required. 7.10.23.17 ethernet mode register (psmr). the ethernet mode register is a 16- bit, memory-mapped, read-write register that controls the scc operation. the term ethernet mode register refers to the psmr of the scc when that scc is configured for ethernet. this register is cleared at reset. 1514131211109876543210 hbc fc rsh iam crc pro bro sbt lpb sip lcw nib fde
serial communication controllers (sccs) motorola mc68360 user? manual 7-257 hbc?eartbeat checking 0 = no heartbeat checking is performed. do not wait for a collision after transmission. 1 = wait 20 transmit clocks (2 m s) for a collision asserted by the transceiver after trans- mission. the hb bit in the tx bd is set if the heartbeat is not heard within 20 trans- mit clocks. fc?orce collision 0 = normal operation. 1 = force collision. the channel forces a collision on transmission of every transmit frame. the quicc should be configured in loopback operation when using this feature, which allows the quicc collision logic to be tested by the user. it will result in the retry limit being exceeded for each transmit frame. rsh?eceive short frames 0 = discard short frames (less than minflr in length) 1 = receive short frames iam?ndividual address mode 0 = normal operation. a single 48-bit physical address stored in paddr1 is checked on receive. 1 = the individual hash table is used to check all individual addresses that are re- ceived. crc?rc selection 00 = reserved. 01 = reserved. 10 = 32-bit ccitt-crc (ethernet). (x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x1 +1). select this to comply with ethernet specifica- tions. 11 = reserved. pro?romiscuous 0 = check the destination address of the incoming frames. 1 = receive the frame regardless of its address, unless the rrjct pin is asserted dur- ing the frame reception. bro?roadcast address 0 = receive all frames containing the broadcast address. 1 = reject all frames containing the broadcast address unless pro = 1. sbt?top backoff timer 0 = the backoff timer functions normally. 1 = the backoff timer (for the random wait after a collision) is stopped whenever carrier sense is active. in this method, the retransmission is less aggressive than the max- imum allowed in the ieee 802.3 standard. the persistence (p_per) feature in the parameter ram may be used in combination with the sbt bit (or in place of the sbt bit), if desired.
serial communication controllers (sccs) 7-258 mc68360 user? manual motorola lpb?oopback operation 0 = normal operation. 1 = loopback operation. the channel is configured into internal or external loopback operation as determined by the diag bits in the gsmr. for external loopback, the diag bits should be configured for normal operation. for internal loopback, the diag bits should be configured for loopback operation. sip?ample input pins 0 = normal operation. 1 = after the frame is received, the value on the pb15?b8 pins is sampled and written to the end of the last receive buffer of the frame. this value is called a tag byte. if the frame is discarded, the ethernet:tag byte is also discarded. lcw?ate collision window 0 = the definition of a late collision is any collision that occurs 64 or more bytes from the preamble. 1 = the definition of a late collision is any collision that occurs 56 or more bytes from the preamble. nib?umber of ignored bits this parameter determines how soon after rena assertion that the ethernet controller should begin looking for the start frame delimiter. in most situations, the user would select 22 bits. 000 = begin searching for the sfd 13 bits after the assertion of rena. 001 = begin searching for the sfd 14 bits after the assertion of rena. 010 = begin searching for the sfd 15 bits after the assertion of rena. 011 = begin searching for the sfd 16 bits after the assertion of rena. 100 = begin searching for the sfd 21 bits after the assertion of rena. 101 = begin searching for the sfd 22 bits after the assertion of rena. 110 = begin searching for the sfd 23 bits after the assertion of rena. 111 = begin searching for the sfd 24 bits after the assertion of rena. fde?ull duplex ethernet (bit 0 of psmr) 0 = disable full duplex ethernet mode. 1 = enable full duplex ethernet. note when this bit is set to 1 the lpb bit must also be set to 1. 7.10.23.18 ethernet receive buffer descriptor (rx bd). the ethernet con- troller uses the rx bd to report information about the received data for each buffer. figure 7-71 shows an ethernet rx bd example.
serial communication controllers (sccs) motorola mc68360 user? manual 7-259 figure 7-71. ethernet rx bd example mrblr = 64 bytes for this scc buffer 64 bytes time buffer buffer buffer full e length receive bd 0 status 0040 pointer 0 e length receive bd 1 status 0045 pointer 0 1 0 l e length receive bd 2 status pointer 1 e length receive bd 3 status xxxx pointer 1 buffer present time 1 f 0 lf non-collided ethernet frame 1 two frames received in ethernet line idle old data from collided frame will be overwritten. crc bytes (4) tag byte (1) dest address (6) source address (6) type/length (2) data bytes (50) collision 32-bit buffer pointer 32-bit buffer pointer 32-bit buffer pointer 32-bit buffer pointer frame 2 64 bytes 64 bytes 64 bytes xxxx buffer closed after crc received. optional tag byte appended. collision causes buffer to be reused. buffer still empty empty empty empty
serial communication controllers (sccs) 7-260 mc68360 user? manual motorola note: entries in boldface must be initialized by the user. e?mpty 0 = the data buffer associated with this rx bd has been filled with received data, or data reception has been aborted due to an error condition. the cpu32+ core is free to examine or write to any fields of this rx bd. the cp will not use this bd again while the e-bit remains zero. 1 = the data buffer associated with this rx bd is empty, or reception is currently in progress. this rx bd and its associated receive buffer are owned by the cp. once the e bit is set, the cpu32+ core should not write any fields of this rx bd. bits 14, 9??eserved w?rap (final bd in table) 0 = this is not the last bd in the rx bd table. 1 = this is the last bd in the rx bd table. after this buffer has been used, the cp will receive incoming data into the first bd in the table (the bd pointed to by rbase). the number of rx bd s in this table is programmable and is determined only by the w-bit and the overall space constraints of the dual-port ram. i?nterrupt 0 = no interrupt is generated after this buffer has been used. 1 = the rxb bit or rxf bit in the ethernet event register will be set when this buffer has been used by the ethernet controller. these two bits may cause interrupts if they are enabled. l?ast in frame this bit is set by the ethernet controller when this buffer is the last in a frame. this implies the end of the frame or reception of an error, in which case one or more of the cl, ov, cr, sh, no, and lg bits are set. the ethernet controller will write the number of frame octets to the data length field. 0 = the buffer is not the last in a frame. 1 = the buffer is the last in a frame. f?irst in frame this bit is set by the ethernet controller when this buffer is the first in a frame. 0 = the buffer is not the first in a frame. 1 = the buffer is the first in a frame. m?iss this bit is set by the ethernet controller for frames that were accepted in promiscuous mode, but were flagged as a "miss" by the internal address recognition. thus, while in pro- 1514131211109876543210 offset + 0 e wi l f lgnoshcrovcl offset + 2 data length offset + 4 rx data buffer pointer offset + 6
serial communication controllers (sccs) motorola mc68360 user? manual 7-261 miscuous mode, the user can use the miss bit to quickly determine whether the frame was destined to this station. this bit is valid only if the l bit is set. 0 = the frame was received because of an address recognition hit. 1 = the frame was received because of promiscuous mode. lg?x frame length violation a frame length greater than the maximum defined for this channel was recognized (only the maximum-allowed number of bytes is written to the data buffer). no?x nonoctet aligned frame a frame that contained a number of bits not divisible by 8 was received, and the crc check that occurred at the preceding byte boundary generated an error. sh?hort frame a frame length that was less than the minimum defined for this channel was recognized. this indication is possible only if the rsh bit is set in the psmr. cr?x crc error this frame contains a crc error. ov?verrun a receiver overrun occurred during frame reception. cl?ollision this frame was closed because a collision occurred during frame reception. this bit will be set only if a late collision occurred or if the rsh bit is enabled in the psmr. the late collision definition is determined by the lcw bit in the psmr. data length the data length is the number of octets written by the cp into this bd? data buffer. it is written by the cp once as the buffer is closed. when this bd is the last bd in the frame (l = 1), the data length contains the total number of frame octets (including four bytes for crc). note the actual amount of memory allocated for this buffer should be greater than or equal to the contents of the mrblr. rx data buffer pointer the receive buffer pointer, which always points to the first location of the associated data buffer, may reside in either internal or external memory. this pointer must be divisible by 4. 7.10.23.19 ethernet transmit buffer descriptor (tx bd). data is presented to the ethernet controller for transmission on an scc channel by arranging it in buffers ref-
serial communication controllers (sccs) 7-262 mc68360 user? manual motorola erenced by the channel? tx bd table. the ethernet controller confirms transmission or indi- cates error conditions using the bds to inform the host that the buffers have been serviced. note: entries in boldface must be initialized by the user. r?eady 0 = the data buffer associated with this bd is not ready for transmission. the user is free to manipulate this bd or its associated data buffer. the cp clears this bit after the buffer has been transmitted or after an error condition is encountered. 1 = the data buffer, which has been prepared for transmission by the user, has not been transmitted or is currently being transmitted. no fields of this bd may be writ- ten by the user once this bit is set. pad?hort frame padding this bit is valid only when the l-bit is set; otherwise, it is ignored. 0 = do not add pads to short frames. 1 = add pads to short frames. pad bytes will be inserted until the length of the trans- mitted frame equals the minflr. the pad bytes are stored in pads in the param- eter ram. w?rap (final bd in table) 0 = this is not the last bd in the tx bd table. 1 = this is the last bd in the tx bd table. after this buffer has been used, the cp will receive incoming data into the first bd in the table (the bd pointed to by tbase). the number of tx bd s in this table is programmable and is determined only by the w-bit and the overall space constraints of the dual-port ram. note the txbd table must contain more than one bd in ethernet mode. i?nterrupt 0 = no interrupt is generated after this buffer has been serviced. 1 = the txb bit or txe bit will be set in the ethernet event register after this buffer has been serviced. these bits can cause interrupts if they are enabled. l?ast 0 = this is not the last buffer in the transmit frame. 1 = this is the last buffer in the current transmit frame. 1514131211109876543210 offset + 0 r pad w i l tc def hb lc rl rc un csl offset + 2 data length offset + 4 tx data buffer pointer offset + 6
serial communication controllers (sccs) motorola mc68360 user? manual 7-263 tc?x crc this bit is valid only when the l-bit is set; otherwise, it is ignored. 0 = end transmission immediately after the last data byte. 1 = transmit the crc sequence after the last data byte. the following status bits are written by the ethernet controller after it has finished transmit- ting the associated data buffer. def?efer indication this frame had a collision before being successfully sent. useful for channel statistics. hb?eartbeat the collision input was not asserted within 20 transmit clocks following the completion of transmission. this bit cannot be set unless the hbc bit is set in the psmr. lc?ate collision a collision has occurred after the number of bytes defined with the lcw bit in the psmr (either 56 or 64) have been transmitted. the ethernet controller will terminate the trans- mission. rl?etransmission limit the transmitter has failed retry limit + 1 attempts to successfully transmit a message due to repeated collisions on the medium. rc?etry count these four bits indicate the number of retries required before this frame was successfully transmitted. if rc = 0, then the frame was transmitted correctly the first time. if rc = 15 and ret_lim = 15 in the parameter ram, then 15 retries were required. if rc = 15 and ret_lim > 15 in the parameter ram, then 15 or more retries were required. un?nderrun the ethernet controller encountered a transmitter underrun condition while transmitting the associated data buffer. csl?arrier sense lost carrier sense was lost during frame transmission. data length the data length is the number of octets the ethernet controller should transmit from this bd? data buffer. it is never modified by the cp. the value of this field should be greater than zero. tx data buffer pointer the transmit buffer pointer, which contains the address of the associated data buffer, may be even or odd. the buffer may reside in either internal or external memory. this value is never modified by the cp.
serial communication controllers (sccs) 7-264 mc68360 user? manual motorola 7.10.23.20 ethernet event register (scce). the scce is called the ethernet event register when the scc is operating as an ethernet controller. it is a 16-bit register used to report events recognized by the ethernet channel and to generate interrupts. on recognition of an event, the ethernet controller will set the corresponding bit in the ethernet event register. interrupts generated by this register may be masked in the ethernet mask register. an example of interrupts that may be generated in the hdlc protocol is given in figure 7-72. the ethernet event register is a memory-mapped register that may be read at any time. a bit is cleared by writing a one (writing a zero does not affect a bit? value). more than one bit may be cleared at a time. all unmasked bits must be cleared before the cp will clear the internal interrupt request. this register is cleared at reset. bits 15?, 6??eserved gra?raceful stop complete a graceful stop, which was initiated by the graceful stop transmit command, is now complete. this bit is set as soon the transmitter has finished transmitting any frame that was in progress when the command was issued. it will be set immediately if no frame was in progress when the command was issued. txe?x error an error occurred on the transmitter channel. rxf?x frame a complete frame was received on the ethernet channel. bsy?usy condition a frame was received and discarded due to lack of buffers. txb?x buffer a buffer has been transmitted on the ethernet channel. rxb?x buffer a buffer that was not a complete frame has been received on the ethernet channel. 1514131211109876543210 gratxerxfbsytxbrxb
serial communication controllers (sccs) motorola mc68360 user? manual 7-265 figure 7-72. ethernet interrupt events example ; 7.10.23.21 ethernet mask register (sccm). the sccm is referred to as the ether- net mask register when the scc is operating as an ethernet controller. it is a 16-bit read- write register that has the same bit formats as the ethernet event register. if a bit in the ethernet mask register is a one, the corresponding interrupt in the event register will be enabled. if the bit is zero, the corresponding interrupt in the event register will be masked. this register is cleared upon reset. 7.10.23.22 ethernet status register (sccs). this register is not valid for the ethernet protocol. the current state of the rena and clsn signals may be read in port c. line idle stored in rx buffer frame received in ethernet time rxd line idle line idle stored in tx buffer clsn line idle txd tena rxb txb notes: 1. rxb event assumes receive buffers are 64 bytes each. 2. the rena events, if required, must be programmed in the port c parallel i/o, not in the scc itself. 3. the rxf interrupt may occur later than rena due to receive fifo latency. legend: p = preamble, sfd = start frame delimiter, da and sa = source/destination address, t/l = type/length, d = data, and cr = crc bytes. notes: 1. txb events assume the frame required two transmit buffers. 2. the gra event assumes a graceful stop transmit command was issued during frame transmission. 3. the tena or clsn events, if required, must be programmed in the port c parallel i/o, not in the scc itself. ethernet scce events hdlc scce events frame transmitted by ethernet da sa t/l cr d rxf p rena sfd da sa t/l cr d p txb gra sfd
serial communication controllers (sccs) 7-266 mc68360 user? manual motorola 7.10.23.23 scc ethernet example. the following list is an initialization sequence for an ethernet channel. scc1 is used. the clk1 pin is used for the ethernet receiver, and the clk2 pin is used for the ethernet transmitter. 1. the sdcr (sdma configuration register) should be initialized to $0740, rather than being left at its default value of $0000. 2. configure the port a pins to enable the txd1 and rxd1 pins. write papar bits 0 and 1 with ones. write padir bits 0 and 1 with zeros. write paodr bit 1 with zero. 3. configure the port c pins to enable cts1 (clsn) and cd1 (rena). write pcpar bits 4 and 5 with zeros. write pcdir bits 4 and 5 with zero. write pcso bits 4 and 5 with ones. 4. do not enable the rts1 (tena) pin yet because the pin is still functioning as rts (inactive in the high state), and transmission on the lan could accidentally begin. 5. configure port a to enable the clk1 and clk2 pins. write papar bits 8 and 9 with a ones. write padir bits 8 and 9 with zeros. 6. connect the clk1 and clk2 pins to scc1 using the si. write the r1cs bits in sicr to 101. write the t1cs bits in sicr to 100. 7. connect the scc1 to the nmsi (i.e., its own set of pins). clear the sc1 bit in the sicr. 8. write rbase and tbase in the scc parameter ram to point to the rx bd and tx bd in the dual-port ram. assuming one rx bd at the beginning of dual-port ram, and one tx bd following that rx bd, write rbase with $0000 and tbase with $0008. 9. program the cr to execute the init rx & tx params command for this channel. for instance, to execute this command for scc1, write $0001 to the cr. this com- mand causes the rbptr and tbptr parameters of the serial channel to be updated with the new values just programmed into rbase and tbase. 10. write rfcr with $18 and tfcr with $18 for normal operation. 11. write mrblr with the maximum number of bytes per receive buffer. for this case, assume 1520 bytes, so mrblr = $05f0. (in this example, the user wants to receive an entire frame into one buffer, so the mrblr value is simply chosen to be the first value larger than 1518 that is evenly divisible by 4). 12. write c_pres with $ffffffff to comply with 32-bit ccitt-crc. 13. write c_mask with $debb20e3 to comply with 32-bit ccitt-crc. 14. clear crcec, alec, and disfc for the sake of clarity. 15. write pad with $8888 for the pad value. 16. write ret_lim with $000f. 17. write mflr with $05ee to make the maximum frame size 1518 bytes. 18. write minflr with $0040 to make the minimum frame size 64 bytes. 19. write maxd1 and maxd2 with $05ee to make the maximum dma count 1518 bytes.
serial communication controllers (sccs) motorola mc68360 user? manual 7-267 20. clear gaddr1?addr4. the group hash table is not used. 21. write paddr1_h with $0000, paddr1_m with $0000, and paddr1_l with $0040 to configure the physical address. 22. write p_per with $0000. it is not used. 23. clear iaddr1?addr4. the individual hash table is not used. 24. clear taddr_h, taddr_m, and taddr_l for the sake of clarity. 25. initialize the rx bd. assume the rx data buffer is at $00001000 in main memory. write $b000 to rx_bd_status. write $0000 to rx_bd_length (not required done for instructional purposes only). write $00001000 to rx_bd_pointer. 26. initialize the tx bd. assume the tx data frame is at $00002000 in main memory and contains fourteen 8-bit characters (destination and source addresses plus the type field). write $fc00 to tx_bd_status. add pad to the frame and generate a crc. write $000d to tx_bd_length. write $00002000 to tx_bd_pointer. 27. write $ffff to the scce to clear any previous events. 28. write $001a to the sccm to enable the txe, rxf, and txb interrupts. 29. write $40000000 to the cimr to allow scc1 to generate a system interrupt. (the cicr should also be initialized.) 30. write $00000000 to gsmr_h1 to enable normal operation of all modes. 31. write $1088000c to gsmr_l1 to configure the cts (clsn) and cd (rena) pins to automatically control transmission and reception (diag bits) and the ethernet mode. tci is set to allow more setup time for the eest to receive the quicc? transmit data. tpl and tpp are set as required for ethernet. the dpll is not used with ethernet. notice that the transmitter (ent) and receiver (enr) have not been enabled yet. 32. write $d555 to dsr 33. set the psmr1 to $0a0a to configure 32-bit crc, promiscuous mode (receive all frames), and begin searching for the start frame delimiter 22 bits after rena. 34. enable the tena pin (rts ). since the mode bits in gsmr have been written to ethernet, the tena signal is low. write pcpar bit 0 with a one. write pcdir bit 0 with a zero. 35. write $1088003c to gsmr_l1 to enable the scc1 transmitter and receiver. this additional write ensures that the ent and enr bits will be enabled last. note after 14 bytes and the 46 bytes of automatic pad (plus the 4 bytes of crc) have been trans- mitted, the tx bd is closed. additionally, the receive buffer is closed after a frame is re- ceived. any additional receive data beyond 1520 bytes or a single frame will cause a busy (out-of-buffers) condition since only one rx bd was prepared.
serial management controllers (smcs) 7-268 mc68360 user? manual motorola 7.11 serial management controllers (smcs) the smc key features are as follows: each smc can implement the uart protocol on its own pins. each smc can implement a totally transparent protocol on a multiplexed line or on a nonmultiplexed line. this mode can also be used for a fast connection between quiccs. each smc channel fully supports the c/i and monitor channels of the gci (iom-2) in isdn applications. two smcs fully support the two sets of c/i and monitor channels in the scit channel 0 and channel. 1 full-duplex operation. local loopback and echo capability for testing. 7.11.1 smc overview the smcs are two full-duplex ports that may be independently configured to support any one of three protocols: uart, transparent, or gci. the smcs can support simple uart operation for such purposes as providing a debug/ monitor port in an application, allowing the four sccs to be free for another purpose. the uart functionality of the smcs is reduced as compared to the sccs. the smc clock can be derived from one of the four internal baud rate generators or from an external clock pin. the clock provided to the smc should be a 16x clock. the smcs can also support totally transparent operation. in this mode, the smc may be connected to a tdm channel (such as a t1 line) or directly to its own set of pins. the receive and transmit clocks can be derived from the tdm channel, the internal baud rate generators, or from an external clock. in either case, the clock provided to the smcs should be a 1x clock. the transparent protocol also allows the use of an external synchronization pin for the transmitter and receiver. the transparent functionality of the smcs is reduced as compared to the sccs. finally, each smc can support the c/i and monitor channels of the gci bus (iom-2). in this case, the smc is connected to a tdm channel in the si. see 7.8 serial interface with time slot assigner for the details of configuring the gci interfaces. the smcs support loopback and echo modes for testing. note in the mc68302, the smcs also provide support for the a and m bits of the idl definition. since the idl definition has been mod- ified to eliminate the a and m bits, the quicc does not provide special smc support for idl; however, the a and m bits may still be routed to the smc using the tsa, if desired. the smc would be configured into transparent mode for this operation.
serial management controllers (smcs) motorola mc68360 user? manual 7-269 refer to figure 7-73 for the smc block diagram. the smc receiver and transmitter are dou- ble-buffered, as shown in the block diagram. this corresponds to an effective fifo size (latency) of two characters. figure 7-73. smc block diagram the receive data source for an smc can be either the l1rxd pin if the smc is connected to a tdm channel of the si, or the smrxd pin if the smc is connected to the nmsi. the transmit data source can either be the l1txd pin if the smc is connected to a tdm, or the smtxd pin if the smc is connected to the nmsi. if the smc is connected to a tdm, the smc receive clock and smc transmit clock can be independent from each other as defined in the si description. however, if the smc is con- nected to the nmsi, the smc receive clock and smc transmit clock must be connected to a single clock source called smclk. smclk is an internal signal name for a clock that is generated from the bank of clocks defined in the si description. smclk may originate from an external pin or one of the four internal baud rate generators. see 7.8.9 nmsi configura- tion for more details. if the smc is connected to a tdm, it derives its synchronization pulse from the tsa as defined in the si description. otherwise, if the smc is connected to the nmsi and the totally transparent protocol is selected, the smc may use the smsyn pin as a synchronization pin to determine when transmission and reception should begin. (the smsyn pin is not used in the smc uart mode.) receiver ser to par transmitter par to ser mode _register peripheral bus imb control tx clock rx clock rx data tx data r_ data_ register t_ data_ register from l1rxd in si or smrxd to l1txd in si or smtxd sync from si or smsyn from si or smclk from si or smclk
serial management controllers (smcs) 7-270 mc68360 user? manual motorola 7.11.2 general smc mode register (smcmr) the operating mode of each smc port is defined by the 16-bit, memory-mapped, read-write smcmr. see the specific smc protocol for more information on this register. 7.11.3 smc buffer descriptors when the smcs are configured to operate in gci mode, the memory structure for the smcs is pre-defined to be one word long for transmit and one word long for receive. these one- word structures are detailed later when the gci operation is described in more detail. however, in uart and transparent modes of operation, the smcs have a memory structure that is like that of the sccs. the data associated with the smcs is stored in buffers. each buffer is referenced by bd organized in a buffer descriptor ring located in the dual-port ram (see figure 7-74). figure 7-74. smc memory structure the bd ring allows the user to define buffers for transmission and buffers for reception. each bd ring forms a circular queue. the cp confirms reception and transmission (or indicates error conditions) using the bds to inform the processor that the buffers have been serviced. the actual buffers may reside in either external memory or internal memory. data buffers may reside in the parameter area of an scc or smc if that channel is not enabled. 7.11.4 smc parameter ram each smc parameter ram area begins at the same offset from each smc base area. the protocol-specific portions of the smc parameter ram are discussed in the specific protocol frame status data length data pointer pointer to smcx tx ring dual-port ram external memory tx bd ring tx data buffer pointer to smcx rx ring rx bd ring rx data buffer tx data buffer frame status data length data pointer
serial management controllers (smcs) motorola mc68360 user? manual 7-271 descriptions. the part of the smc parameter ram that is the same for the uart and trans- parent smc protocols is shown in table 7-12. the following discussion does not apply to the gci smc protocol, which has its own parameter ram. not e: the boldfaced items should be initialized by the user. certain parameter ram values (marked in boldface) need to be initialized by the user before the smc is enabled; other values are initialized/written by the cp. once initialized, most parameter ram values will not need to be accessed in user software since most of the activ- ity is centered around the transmit and receive bds, not the parameter ram. however, if the parameter ram is accessed by the user, the following restrictions should be noted. the parameter ram can be read at any time. the parameter ramvalues related to the smc transmitter can only be written whenever the ten bit in the smc mode register is zero, after a stop transmit and before a restart transmit command. the parameter ram values related to the smc receiver can only be written whenever the ren bit in the smc mode register is zero or if the receiver has previously been enabled after an enter hunt mode command or close rx bd command before the ren bit is set. 7.11.4.1 bd table pointer (rbase, tbase). the rbase and tbase entries define the starting location in the dual-port ram for the set of bds for receive and transmit func- tions of the smc. this provides a great deal of flexibility in how bds for an smc are parti- tioned. by selecting rbase and tbase entries for all smcs, and by setting the w-bit in the last bd in each bd list, the user may select how many bds to allocate for the transmit and receive side of every smc. the user must initialize these entries before enabling the corre- table 7-12. smc uart and transparent address name width description smc base + 00 rbase word rx buffer descriptors base address smc base + 02 tbase word tx buffer descriptors base address smc base + 04 rfcr byte rx function code smc base + 05 tfcr byte tx function code smc base + 06 mrblr word maximum receive buffer length smc base + 08 rstate long rx internal state smc base + 0c long rx internal data pointer smc base + 10 rbptr word rx buffer descriptor pointer smc base + 12 word rx internal byte count smc base + 14 long rx temp smc base + 18 tstate long tx internal state smc base + 1c long tx internal data pointer smc base + 20 tbptr word tx buffer descriptor pointer smc base + 22 word tx internal byte count smc base + 24 long tx temp smc base + 28 first word of protocol specific area smc base + 36 last word of protocol specific area
serial management controllers (smcs) 7-272 mc68360 user? manual motorola sponding channel. furthermore, the user should not configure bd tables of two enabled smcs to overlap, or erratic operation will occur. note rbase and tbase should contain a value that is divisible by 8. 7.11.4.2 smc function code registers (rfcr, tfcr). there are four separate function code registers for the two smc channels: two for receive data buffers (rfcrx) and two for transmit data buffers (tfcrx). the fc entry contains the value that the user would like to appear on the function code pins fc3?c0 when the associated sdma channel accesses memory. it also controls the byte-ordering convention to be used in the transfers. receive function code register bits 7??eserved mot?otorola this bit should be set by the user to achieve normal operation. mot must be set if the data buffer is located in external memory and has a 16-bit wide memory port size. 0 = dec (and intel) convention is used for byte ordering?wapped operation. it is also called little-endian byte ordering. the bytes stored in each buffer word are reversed as compared to the motorola mode. 1 = motorola byte ordering?ormal operation. it is also called big-endian byte order- ing. as data is received from the serial line and put into the buffer, the most signif- icant byte of the buffer word contains data received earlier than the least significant byte of the same buffer word. fc3?c0?unction code 3? these bits contain the function code value used during this sdma channel? memory accesses. the user should write bit fc3 with a one to identify this sdma channel access as a dma-type access. example: fc3?c0 = 1000 (binary). do not write the value 0111 (binary) to these bits. transmit function code register bits 7??eserved 76543210 mot fc3?c0 76543210 mot fc3?c0
serial management controllers (smcs) motorola mc68360 user? manual 7-273 mot?otorola this bit should be set by the user to achieve normal operation. mot must be set if the data buffer is located in external memory and has a 16-bit wide memory port size. 0 = dec (and intel) convention is used for byte ordering?wapped operation. it is also called little-endian byte ordering. the transmission order of bytes within a buffer word is reversed as compared to the motorola mode. 1 = motorola byte ordering?ormal operation. it is also called big-endian byte order- ing. as data is transmitted onto the serial line from the data buffer, the most signif- icant byte of the buffer word contains data to be transmitted earlier than the least significant byte of the same buffer word. fc3?c0?unction code 3? these bits contain the function code value used during this sdma channel? memory ac- cesses. the user should write bit fc3 with a one to identify this sdma channel access as a dma-type access. example: fc3?c0 = 1000 (binary). do not write the value 0111 (bi- nary) to these bits. 7.11.4.3 maximum receive buffer length register (mrblr). each smc has one mrblr to define the receive buffer length for that smc. mrblr defines the maximum number of bytes that the quicc will write to a receive buffer on that smc before moving to the next buffer. the quicc may write fewer bytes to the buffer than mrblr if a condition such as an error or end-of-frame occurs, but it will never write more bytes than the mrblr value. it follows, then, that buffers supplied by the user for use by the quicc should always be of size mrblr (or greater) in length. the transmit buffers for an smc are not affected in any way by the value programmed into mrblr. transmit buffers may be individually chosen to have varying lengths, as needed. the number of bytes to be transmitted is chosen by programming the data length field in the tx bd. notes mrblr should not be changed dynamically while an smc is op- erating. however, if it is modified in a single bus cycle with one 16-bit move (not two 8-bit bus cycles back-to-back), then a dy- namic change in receive buffer length can be successfully achieved. this occurs when the cp moves control to the next rx bd in the table. thus, a change to mrblr will not have an im- mediate effect. to guarantee the exact rx bd on which the change will occur, the user should change mrblr only while the smc receiver is disabled. the mrblr value should be greater than zero, and should be even if the character length of the data is greater than 8 bits. 7.11.4.4 receiver buffer descriptor pointer (rbptr). the rbptr for each smc channel points to the next bd that the receiver will transfer data to when it is in idle state or to the current bd during frame processing. after a reset or when the end of the bd table is reached, the cp initializes this pointer to the value programmed in the rbase entry.
serial management controllers (smcs) 7-274 mc68360 user? manual motorola although rbptr need never be written by the user in most applications, it may be modified by the user when the receiver is disabled or when the user is sure that no receive buffer is currently in use. 7.11.4.5 transmitter buffer descriptor pointer (tbptr). the tbptr for each smc channel points to the next bd that the transmitter will transfer data from when it is in idle state or to the current bd during frame transmission. after a reset or when the end of the bd table is reached, the cp initializes this pointer to the value programmed in the tbase entry. although tbptr need never be written by the user in most applications, it may be modified by the user when the transmitter is disabled or when the user is sure that no transmit buffer is currently in use (e.g., after a stop transmit command is issued, or after a graceful stop transmit command is issued, and the frame completes its transmission.) 7.11.4.6 other general parameters. additional parameters are listed in table 7- 12. these parameters do not need to be accessed by the user in normal operation, and are listed only because they may provide helpful information for experienced users and for debugging. the rx and tx internal data pointers are updated by the sdma channels to show the next address in the buffer to be accessed. the tx internal byte count is a down-count value that is initialized with the tx bd data length and decremented with every byte read by the sdma channels. the rx internal byte count is a down-count value that is initialized with the mrblr value and decremented with every byte written by the sdma channels. note to extract data from a partially full receive buffer, the close rx bd command may be used. the rx internal state, tx internal state, rx temp, tx temp, and reserved areas are for risc use only. 7.11.5 disabling the smcs on the fly if an smc is not needed for a period of time, it may be disabled and re-enabled later. in this case, a sequence of operations is followed. this sequence ensures that any buffers in use will be properly closed and that new data will be transferred to/from a new buffer. such a sequence is required if the parameters that must be changed are not allowed to be changed dynamically. if the register or bit description states that dynamic (on-the-fly) changes are allowed, the following sequences are not required, and the register or bit may be changed immediately. in all other cases, the sequence should be used. for instance, the baudrate generators allow on-the-fly changes.
serial management controllers (smcs) motorola mc68360 user? manual 7-275 notes the modification of parameter ram does not require a full dis- abling of the smc. see the parameter ram description for de- tails on when parameter ram values may be modified. if the user desires to disable all sccs, smcs, and spi, then the cr may be used to reset the entire cp with a single command. 7.11.5.1 smc transmitter full sequence. for the smc transmitter, the full dis- able and enable sequence is as follows: 1. stop transmit command. this command is recommended if the smc is currently in the process of transmitting data since it stops transmission in an orderly way. if the smc is not transmitting (e.g., no tx bds are ready), then the stop transmit com- mand is not required. furthermore, if the tbptr will be overwritten by the user or the init tx parameters command will be executed, this command is not required. 2. clear the ten bit in the smcmr. this disables the smc transmitter and puts it in a reset state. 3. make modifications. the user may make modifications to the smc transmit parame- ters including the parameter ram. if the user desires to switch protocols or restore the smc transmit parameters to their initial state, the init tx parameters command may now be issued. 4. restart transmit command. this command is required if the init tx parame- ters command was not issued in step 3. 5. set the ten bit in the smcmr. transmission will now begin using the tx bd pointed to by the tbptr value as soon as the tx bd r-bit is set. 7.11.5.2 smc transmitter shortcut sequence. a shorter sequence is possible if the user desires to reinitialize the transmit parameters to the state they had after reset. this sequence is as follows: 1. clear the ten bit in the smcmr. 2. init tx parameters command. any additional modifications may now be made. 3. set the ten bit in the smcmr. 7.11.5.3 smc receiver full sequence. for the receiver, the full disable and enable sequence is as follows: 1. clear the ren bit in the smcmr. reception will be aborted immediately. this disables the receiver of the smc and puts it in a reset state. 2. make modifications. the user may make modifications to the smc receive parameters including the parameter ram. if the user desires to switch protocols or restore the smc receive parameters to their initial state, the init rx parameters command may now be issued. 3. close rx bd command. this command is required if the init rx parameters command was not issued in step 2. 4. set the ren bit in the smcmr. reception will now begin immediately using the rx
serial management controllers (smcs) 7-276 mc68360 user? manual motorola bd pointed to by the rbptr if the rx bd e-bit is set. 7.11.5.4 smc receiver shortcut sequence. a shorter sequence is possible if the user desires to reinitialize the receive parameters to the state they had after reset. this se- quence is as follows: 1. clear the ren bit in the smcmr. 2. init rx parameters command. any additional modifications may now be made. 3. set the ren bit in the smcmr. 7.11.5.5 switching protocols. sometimes the user desires to switch the protocol that the smc is executing (for instance, uart to transparent) without resetting the board or affecting any other smc. this can be accomplished using only one command and a short number of steps: 1. clear the ten and ren bits in the smcmr. 2. init tx and rx parameters command. this one command initializes both trans- mit and receive parameters. any additional modifications may now be made in the sm- cmr to change the protocol, etc. 3. set the smcmr ten and ren bits. the smc is enabled with the new protocol. 7.11.6 saving power when the ten and ren bits of an smc are cleared, that smc consumes a minimal amount of power. 7.11.7 smc as a uart the following paragraphs describe the use of the smc as a uart. 7.11.7.1 smc uart key features. the smc uart contains the following key fea- tures: flexible message-oriented data structure programmable data length (5?4 bits) programmable 1 or 2 stop bits even/odd/no parity generation and checking frame error, break, and idle detection transmit preamble and break sequences received break character length indication continuous receive and transmit modes 7.11.7.2 smc uart comparison. as compared to the uart modes supported by the sccs, the smcs generally offer less functionality and performance. this fits with their pur- pose of providing simple debug/monitor ports rather than full-featured uarts. the smc uarts do not support the following features: rts , cts , and cd pins receive and transmit sections being clocked at different rates
serial management controllers (smcs) motorola mc68360 user? manual 7-277 fractional stop bits built-in multidrop modes freeze mode for implementing flow control isochronous operation (1x clock) interrupts upon receiving special control characters ability to transmit data on demand using the todr sccs register to determine idle status of the receive pin other features for the sccs as described in the gsmr the smcs in uart mode, however, do provide one feature not provided by the regular sccs. the smcs allow a data length option of up to 14 bits; whereas, the sccs provide a data length up to 8 bits. see figure 7-75 for the smc uart frame format. figure 7-75. smc uart frame format 7.11.7.3 smc uart memory map. when configured to operate in uart mode, the quicc overlays the structure listed in table 7-5 with the uart-specific parameters described in table 7-13. max_idl. once a character of data is received on the line, the uart controller begins counting any idle characters received. if a max_idl number of idle characters is received before the next data character is received, an idle timeout occurs, and the buffer is closed. this, in turn, can produce an interrupt request to the cpu32+ core to receive the data from table 7-13. smc uart-specific parameter ram address name width description smc base + 28 max_idl word maximum idle characters smc base + 2a idlc word temporary idle counter smc base + 2c brkln word last received break length smc base + 2e brkec word receive break condition counter smc base +30 brkcr word break count register (transmit) smc base +32 r_mask word temporary bit mask smtxd smclk 16 start bit 5 to 14 data bits with the least significant bit first par. bit optional 1 or 2 stop bits (clock not to scale)
serial management controllers (smcs) 7-278 mc68360 user? manual motorola the buffer. thus, max_idl provides a convenient way to demarcate frames in the uart mode. if the max_idl functionality is not desired, the user should program max_idl to $0000, and the buffer will never be closed, regardless of the number of idle characters received. a character of idle is calculated as the following number of bit times: 1 + data length (5 to 14) + 1 (if parity bit is used) + number of stop bits (1 or 2). example: for 8 data bits, no parity, and 1 stop bit, the character length is 10 bits. idlc. this value is used by the risc to store the current idle counter value in the max_idl timeout process. idlc is a down-counter; it does not need to be initialized or accessed by the user. brkln. this value is used to store the length of the last break character received. this value is the length in bits of that character. example: if the receive pin is low for 257 bit times, brkln will show the value $0101. brkln is accurate to within one character unit of bits. for example, for 8 data bits, no parity, 1 stop bit, and 1 start bit, brkln is accurate to within 10 bits. brkec. this counter counts the number of break conditions that occurred on the line. note that one break condition may last for hundreds of bit times, yet this counter is incremented only once during that period. brkcr. the smc uart controller will send an a break character sequence whenever a stop transmit command is given. the number of break characters sent by the uart controller is determined by the value in brkcr. in the case of 8 data bits, no parity, 1 stop bit, and 1 start bit, each break character is 10 bits in length and consists of all zeros. 7.11.7.4 smc uart transmission processing. the uart transmitter is designed to work with almost no intervention from the cpu32+ core. when the cpu32+ core enables the smc transmitter, it will start transmitting idles. the smc immediately polls the first bd in the transmit channel? bd ring, and thereafter once every character time, depending on the character length (i.e., every 7 to 16 serial clocks). when there is a message to transmit, the smc will fetch the data from memory and start transmitting the message. when a bd? data has been completely written to the transmit fifo, the smc writes the message status bits into the bd and clears the r-bit. an interrupt is issued if the i-bit in the bd is set. if the next tx bd is ready, the data from its data buffer will be appended to the previous data and transmitted out on the transmit pin, with no gaps occurring between buff- ers. if the next tx bd is not ready, the smc will start transmitting idles and wait for the next tx bd to become ready. by appropriately setting the i-bit in each bd, interrupts can be generated after the transmis- sion of each buffer, a specific buffer, or each block. the smc will then proceed to the next bd in the table. if the cm bit is set in the tx bd, the r-bit will not be cleared, allowing the associated data buffer to be retransmitted automatically when the cp next accesses this data buffer. for instance, if a single tx bd is initialized with the cm bit set and the w-bit set, the data buffer will be continuously transmitted until the user clears the r-bit of the bd.
serial management controllers (smcs) motorola mc68360 user? manual 7-279 7.11.7.5 smc uart reception processing. when the cpu32+ core enables the smc receiver in uart mode, it will enter hunt mode, waiting for the first character to arrive. once the first character arrives, the first rx bd is checked by the cp to see if it is empty. it then begins storing characters in the associated data buffer. when the data buffer has been filled or the max_idl timer has expired (assuming it was enabled), the smc clears the e-bit in the bd and generates an interrupt if the i-bit in the bd is set. if the incoming data exceeds the length of the data buffer, the smc will fetch the next bd in the table and, if it is empty, will continue to transfer data to this bd? associated data buffer. if the cm bit is set in the rx bd, the e-bit will not be cleared, allowing the associated data buffer to be overwritten automatically when the cp next accesses this data buffer. 7.11.7.6 smc uart programming model. an smc configured as a uart uses the same data structure as in the other modes. the smc uart data structure supports multi- buffer operation. the smc uart allows the user to transmit break and preamble sequences. overrun, parity, and framing errors are reported via the bds. in its simplest form, the smc uart can function in a character-oriented environment. each character is transmitted with accompanying stop bits and parity (as configured by the user), and received into separate 1-byte buffers. reception of each buffer may generate a maskable interrupt. many applications may want to take advantage of the message-oriented capabilities sup- ported by the smc uart by using linked buffers (in either receive or transmit). in this case, data is handled in a message-oriented environment; users can work on entire messages rather than operating on a character-by-character basis. a message may span several linked buffers. each message can be both transmitted and received as a linked list of buffers without any intervention from the cpu32+, which achieves both ease in programming and significant savings in processor overhead. in the message-oriented environment, the idle sequence is used as the message delimiter. the transmitter is able to generate an idle sequence before starting a new message, and the receiver is able to close a buffer upon detection of idle sequence. 7.11.7.7 smc uart command set. the following transmit and receive commands are issued to the cr. 7.11.7.7.1 transmit commands. the following paragraphs describe the smc uart transmit commands. stop transmit command . the channel stop transmit command disables the transmission of characters on the transmit channel. if this command is received by the smc uart controller during message transmission, transmission of that message is aborted. the smc uart completes transmission of any data already transferred to its fifo and shift register (up to two characters) and then stops transmitting data. the tbptr is not advanced when this command is issued. the smc uart transmitter will transmit a programmable number of break sequences and then start to transmit idles. the number of break sequences (which may be zero) should be
serial management controllers (smcs) 7-280 mc68360 user? manual motorola written to the break count register before this command is given to the smc uart control- ler. restart transmit command . the restart transmit command enables the transmission of characters on the transmit channel. this command is expected by the smc uart controller after disabling the channel in its smc mode register and after the stop transmit command. the smc uart controller will resume transmission from the current tbptr in the channel? tx bd table. init tx parameters command . this command initializes all the transmit parameters in this serial channel? parameter ram to their reset state. this command should only be issued when the transmitter is disabled. note that the init tx and rx parameters com- mand may also be used to reset both transmit and receive parameters. 7.11.7.7.2 receive commands. the following paragraphs describe the uart receive commands. enter hunt mode command . this command should not be used for an smc uart channel. the close rx bd command may be used instead. close rx bd command . the close rx bd command is used to force the smc to close the current receive bd if it is currently being used, and to use the next bd in the list for any subsequent data that is received. if the smc is not in the process of receiving data, no action is taken by this command. init rx parameters command . this command initializes all the receive parameters in this serial channel? parameter ram to their reset state. this command should only be issued when the receiver is disabled. note that the init tx and rx parameters com- mand may also be used to reset both receive and transmit parameters. 7.11.7.8 send break (transmitter). a break is an all-zeros character without stop bits. a break is sent by issuing the stop transmit command. the smc uart completes transmission of any outstanding data and then sends a character with consecutive zeros (the number of zero bits in this character is the sum of the character length, plus the number of start, parity, and stop bits). the smc uart transmits a programmable number of break characters according to the break count register and then reverts to idle or sends data if the restart transmit command was given before completion. at the completion of the break, the transmitter sends at least one character of idle before transmitting any data to guarantee recognition of a valid start bit. 7.11.7.9 sending a preamble (transmitter). a preamble sequence gives the pro- grammer a convenient way of ensuring that the line goes idle before starting a new mes- sage. the preamble sequence length is constructed of consecutive ones of one character length. if the preamble bit in a bd is set, the smc will send a preamble sequence before transmitting that data buffer. example: for 8 data bits, no parity, 1 stop bit, and 1 start bit, a preamble of 10 ones would be sent before the first character in the buffer. if no preamble sequence is sent, data from two ready transmit buffers may be transmitted without any delay occurring on the transmit pin between the two transmit buffers.
serial management controllers (smcs) motorola mc68360 user? manual 7-281 7.11.7.10 smc uart error-handling procedure. the smc uart reports char- acter reception error conditions via the channel buffer descriptors, and the smc uart event register. there are no transmission errors for the smc uart controller. 7.11.7.10.1 overrun error. the smc uart maintains a two-character length fifo for receiving data (shift register plus data register). the data will be moved to the buffer after the first character is received into the fifo. if a receiver fifo overrun occurs, the channel writes the received character into the internal fifo. then the channel writes the received character to the buffer, closes the buffer, sets the ov bit in the bd, and generates the rx interrupt if it is enabled. reception then continues normally. note the smc uart may occasionally get an overrun when the line is at idle. the user should ignore an overrun error when the line is known to be at idle. 7.11.7.10.2 parity error. when a parity error occurs, the channel writes the received char- acter to the buffer, closes the buffer, sets the pr bit in the bd, and generates the rx inter- rupt if it is enabled. reception then continues normally. 7.11.7.10.3 idle sequence receive. an idle is detected when one character consisting of all ones is received. once an idle is received, the channel counts the number of consecutive idle characters received. if the count reaches the max_idl value, the buffer is closed, and an rx interrupt is generated. if no receive buffer is open, this event does not generate an interrupt or any status information. the idle counter is reset every time a character is received. 7.11.7.10.4 framing error. a framing error is detected by the smc uart controller when a character is received with no stop bit. when this error occurs, the channel writes the received character to the buffer, closes the buffer, sets the fr bit in the bd, and generates the rx interrupt if it is enabled. when this error occurs, parity is not checked for this char- acter. 7.11.7.10.5 break sequence. a break sequence is detected by the smc uart receiver when an all-zero? character with a framing error is received. when a break sequence is received, the channel will increment the brkec and generate a maskable brk interrupt in the smc uart event register. the channel will also measure the length of the break sequence and store this value in the brkln counter. if the channel was in the middle of buffer processing when the break was received, the buffer will be closed with the br bit in the rx bd set, and the rx interrupt will be generated if it is enabled. 7.11.7.11 smc uart mode register (smcmr). the operating mode of an smc is defined by the smcmr. the smcmr is a 16-bit, memory-mapped, read-write register. the register is cleared at reset. the function of bits 7? is common to each smc protocol. the function of bits 15? varies according to the protocol selected by the sm bits. 1514131211109876543210 clen sl pen pm sm dm ten ren
serial management controllers (smcs) 7-282 mc68360 user? manual motorola bits 15, 7, 6?eserved these bits should be cleared by the user. clen?haracter length the clen value should be programmed with the total number of bits in the character mi- nus one. the total number of bits in the character is calculated as the sum of: 1 (start bit always present) + number of data bits (5?4) + number of parity bits (0 or 1) + number of stop bits (1 or 2). example: for 8 data bits, no parity, and 1 stop bit, the total number of bits in the character is 1 + 8 + 0 + 1 = 10. thus, clen should be programmed to 9. the number of data bits in the character may range from 5 to 14 bits. if the data bit length is less than 8 bits, the msbs of each byte in memory are not used on transmit and are written with zeros on receive. if the data bit length is more than 8 bits, the msbs of each 16-bit word in memory are not used on transmit and are written with zeros on receive. notes the total number of bits in the character must never exceed 16. thus, if a 14-bit data length is chosen, sl must be set to one stop bit, and parity should not be enabled. if a 13-bit data length is chosen and parity is enabled, sl must be set to one stop bit. the values 0 to 3 should not be written to clen, or erratic be- havior may result. sl?top length 0 = one stop bit 1 = two stop bits pen?arity enable 0 = no parity 1 = parity is enabled for the transmitter and receiver as determined by the pm bit. pm?arity mode 0 = odd parity 1 = even parity sm?mc mode 00 = gci or scit support 01 = reserved 10 = uart (must be selected for smc uart operation) 11 = totally transparent operation
serial management controllers (smcs) motorola mc68360 user? manual 7-283 dm?iagnostic mode 00 = normal operation 01 = local loopback mode 10 = echo mode 11 = reserved ten?mc transmit enable 0 = smc transmitter disabled 1 = smc transmitter enabled ren?mc receive enable 0 = smc receiver disabled 1 = smc receiver enabled 7.11.7.12 smc uart receive buffer descriptor (rx bd). ?he cp reports infor- mation concerning the received data on a per-buffer basis via rx bds. the cp closes the current buffer, generates a maskable interrupt, and starts to receive data into the next buffer after one of the following events: 1. detection of an error during message processing 2. detection of a full receive buffer 3. reception of a programmable number of consecutive idle characters note: entries in boldface must be initialized by the user. an example of the uart rx bd process is shown in figure 7-76. this figure shows the resulting state of the rx bds after receipt of 10 characters, an idle period, and five charac- ters?ne with a framing error. the example assumes that mrblr = 8 in the smc param- eter ram. e?mpty 0 = the data buffer associated with this rx bd has been filled with received data, or data reception has been aborted due to an error condition. the cpu32+ core is free to examine or write to any fields of this rx bd. the cp will not use this bd again while the e-bit remains zero. 1 = the data buffer associated with this bd is empty, or reception is currently in progress. this rx bd and its associated receive buffer are owned by the cp. once the e-bit is set, the cpu32+ core should not write any fields of this rx bd. bits 14, 11, 10, 7, 6, 2?eserved 1514131211109876543210 offset + 0 e wi cm id br fr pr ov cd offset + 2 data length offset + 4 rx data buffer pointer offset + 6
serial management controllers (smcs) 7-284 mc68360 user? manual motorola w?rap (final bd in table) 0 = this is not the last bd in the rx bd table. 1 = this is the last bd in the rx bd table. after this buffer has been used, the cp will receive incoming data into the first bd in the table (the bd pointed to by rbase). the number of rx bds in this table is programmable and is determined only by the w-bit and the overall space constraints of the dual-port ram. i?nterrupt 0 = no interrupt is generated after this buffer has been filled. 1 = the rx bit in the event register will be set when this buffer has been completely filled by the cp, indicating the need for the cpu32+ core to process the buffer. the rx bit can cause an interrupt if it is enabled. cm?ontinuous mode 0 = normal operation. 1 = the e-bit is not cleared by the cp after this bd is closed, allowing the associated data buffer to be overwritten automatically when the cp next accesses this bd. however, the e-bit will be cleared if an error occurs during reception, regardless of the cm bit. the following status bits are written by the cp after the received data has been into the asso- ciated data buffer. id?uffer closed on reception of idles the buffer was closed due to the reception of the programmable number of consecutive idle sequences. br?uffer closed on reception of break the buffer was closed due to the reception of a break sequence. fr?raming error a character with a framing error was received and is located in the last byte of this buffer. a framing error is a character without a stop bit. a new receive buffer will be used for fur- ther data reception. pr?arity error a character with a parity error was received and is located in the last byte of this buffer. a new receive buffer will be used for further data reception. ov?verrun a receiver overrun occurred during message reception. data length data length is the number of octets that the cp has written into this bd? data buffer. it is written only once by the cp as the bd is closed.
serial management controllers (smcs) motorola mc68360 user? manual 7-285 note the actual amount of memory allocated for this buffer should be greater than or equal to the contents of the mrblr. rx data buffer pointer the receive buffer pointer, which always points to the first location of the associated data buffer, must be even. the buffer may reside in either internal or external memory.
serial management controllers (smcs) 7-286 mc68360 user? manual motorola figure 7-76. smc uart rx bd example 7.11.7.13 smc uart transmit buffer descriptor (tx bd). data is presented to the cp for transmission on an smc channel by arranging it in buffers referenced by the mrblr = 8 bytes for this smc buffer byte 1 byte 2 byte 8 etc. 8 bytes long idle period fourth character has framing error! 5 chars 10 chars characters received by uart time buffer byte 9 byte 10 8 bytes buffer byte 1 byte 2 8 bytes byte 4 has framing error buffer full byte 3 byte 4 error! e length 32-bit buffer pointer receive bd 0 status 0008 pointer 0 e length 32-bit buffer pointer receive bd 1 status 0002 pointer 0 1 id 0 id e length 32-bit buffer pointer receive bd 2 status 0004 pointer 0 id 0 fr 1 e length 32-bit buffer pointer receive bd 3 status xxxx pointer 1 buffer byte 5 8 bytes reception still in progress with this buffer present time idle timeout occurred empty empty additional bytes will be stored unless idle count expires (max_idl)
serial management controllers (smcs) motorola mc68360 user? manual 7-287 channel? tx bd ring. the cp confirms transmission or indicates error conditions via the bds to inform the processor that the buffers have been serviced. note : entries in boldface must be initialized by the user. r?eady 0 = the data buffer associated with this bd is not ready for transmission. the user is free to manipulate this bd or its associated data buffer. the cp clears this bit after the buffer has been transmitted or after an error condition is encountered. 1 = the data buffer, which has been prepared for transmission by the user, has not been transmitted or is currently being transmitted. no fields of this bd may be writ- ten by the user once this bit is set. bits 14, 11, 10, 7??eserved w?rap (final bd in table) 0 = this is not the last bd in the tx bd table. 1 = this is the last bd in the tx bd table. after this buffer has been used, the cp will receive incoming data into the first bd in the table (the bd pointed to by tbase). the number of tx bds in this table is programmable and is determined only by the w-bit and the overall space constraints of the dual-port ram. i?nterrupt 0 = no interrupt is generated after this buffer has been serviced. 1 = the tx bit in the smc uart event register will be set when this buffer has been serviced. tx can cause an interrupt if it is enabled. cm?ontinuous mode 0 = normal operation. 1 = the r-bit is not cleared by the cp after this bd is closed, allowing the associated data buffer to be retransmitted automatically when the cp next accesses this bd. p?reamble 0 = no preamble sequence is sent. 1 = the uart will send one all-ones character before sending the data so that the oth- er end will detect an idle line before the data is received. if this bit is set and the data length of this bd is zero, only a preamble will be sent. 1514131211109876543210 offset + 0 r wi cm p offset + 2 data length offset + 4 tx data buffer pointer offset + 6
serial management controllers (smcs) 7-288 mc68360 user? manual motorola data length the data length is the number of octets that the cp should transmit from this bd? data buffer. it is never modified by the cp. this value should normally be greater than zero. the data length may be equal to zero with the p-bit set, and only a preamble will be sent. if the number of data bits in the uart character is greater than 8, then the data length should be even. example: to transmit three uart characters of 8-bit data, 1 start, and 1 stop, the data length field should be initialized to 3. however, to transmit three uart char- acters of 9-bit data, 1 start, and 1 stop, the data length field should be initialized to 6, since the three 9-bit data fields occupy three words in memory (the 9 lsbs of each word). tx data buffer pointer the transmit buffer pointer, which always points to the first location of the associated data buffer, may be even or odd (unless the number of actual data bits in the uart character is greater than 8 bits, in which case the transmit buffer pointer must be even.) for in- stance, the pointer to 8-bit data, 1 start, and 1 stop characters may be even or odd, but the pointer to 9-bit data, 1 start, and 1 stop characters must be even. the buffer may re- side in either internal or external memory. 7.11.7.14 smc uart event register (smce). when the uart protocol is selected, the smce register is called the smc uart event register. it is an 8-bit register used to report events recognized by the smc uart channel and to generate interrupts. on recog- nition of an event, the uart will set the corresponding bit in the smc uart event register. the smc uart event register is a memory-mapped register that may be read at any time. a bit is cleared by writing a one (writing a zero does not affect a bit? value). more than one bit may be cleared at a time. all unmasked bits must be cleared before the cp will clear the internal interrupt request. this register is cleared at reset. an example of the timing of various events in the smc uart event register is shown in fig- ure 7-77. notes: 1: only available on rev c mask or later. not available on rev a or b. rev a mask is c63t rev b mask are c69t, and f35g current rev c mask are e63c, e68c and f15w 76543210 brke 1 brk bsy tx rx
serial management controllers (smcs) motorola mc68360 user? manual 7-289 bits 7, 5, 3?eserved. brke?reak end the end of break sequence was detected. this indication will be no sonner than after one idle bit is received following a break sequence. brk?reak character received a break character was received. if a very long break sequence occurs, this interrupt will occur only once after the first all-zeros character is received. bsy?usy condition a character was received and discarded due to lack of buffers. this bit is be set no sooner than the middle of the last stop bit of the first receive character for which there is no avail- able buffer. reception continues when an empty buffer is provided. tx?x buffer a buffer has been transmitted over the uart channel. this bit is set once the transmit data of the last character in the buffer was written to the transmit fifo. the user must wait two character times to be sure that the data was completely sent over the transmit pin. rx?x buffer a buffer has been received and its associated rx bd is now closed. this bit is set no soon- er than the middle of the last stop bit of the last character that was written to the receive buffer. figure 7-77. smc uart interrupts example line idle 10 characters characters received by smc uart time rxd line idle line idle 7 characters line idle txd rx rx tx break brk notes: 1. the first rx event assumes receive buffers are six bytes each. 2. the second rx event position is programmable based on the max_idl value. 3. the brk event occurs after the first break character is received. note: the tx event assumes all seven characters were put into a single buffer, and the tx event occurred when the seventh character was written to the smc transmit fifo. smc uart smce events characters transmitted by smc uart smc uart smce events brke
serial management controllers (smcs) 7-290 mc68360 user? manual motorola 7.11.7.15 smc uart mask register (smcm). the smcm is referred to as the smc uart mask register when the smc is operating as a uart. it is an 8-bit read-write register with the same bit format as the smc uart event register. if a bit in the smc uart mask register is a one, the corresponding interrupt in the event register will be enabled. if the bit is zero, the corresponding interrupt in the event register will be masked. this register is cleared upon reset. 7.11.8 smc uart example the following list is an initialization sequence for 9600 baud, 8 data bits, no parity, and 1 stop bit operation of an smc uart assuming a 25-mhz system frequency. brg1 and smc1 are used. 1. the sdcr (sdma configuration register) should be initialized to $0740, rather than being left at its default value of $0000. 2. configure the port b pins to enable the smtxd1 and smrxd1. write pbpar bits 6 and 7 with ones. write pbdir bits 6 and 7 with zeros. write pbodr bits 6 and 7 with zeros. 3. configure the brg1. write brgc1 with $010144. the div16 bit is not used, and the divider is 162 (decimal). the resulting brg1 clock is 16x the desired bit rate of the uart. 4. connect the brg1 clock to smc1 using the si. write the smc1 bit in simode with a 0. write the smc1cs bits in simode with 000. 5. write rbase and tbase in the smc parameter ram to point to the rx bd and tx bd in the dual-port ram. assuming one rx bd at the beginning of dual-port ram and one tx bd following that rx bd, write rbase with $0000 and tbase with $0008. 6. program the cr to execute the init rx & tx params command for this channel. for instance, to execute this command for scc1, write $0001 to the cr. this com- mand causes the rbptr and tbptr parameters of the serial channel to be updated with the new values just programmed into rbase and tbase. 7. write rfcr with $18 and tfcr with $18 for normal operation. 8. write mrblr with the maximum number of bytes per receive buffer. for this case, assume 16 bytes, so mrblr = $0010. 9. write max_idl with $0000 in the smc uart-specific parameter ram to disable the max_idl functionality for this example. 10. clear brkln and brkec in the smc uart-specific parameter ram for the sake of clarity. 11. set brkcr to $0001, so that if a stop transmit command is issued, one break character will be sent. 12. initialize the rx bd. assume the rx data buffer is at $00001000 in main memory. write $b000 to rx_bd_status. write $0000 to rx_bd_length (not required?one for instructional purposes only). write $00001000 to rx_bd_pointer. 13. initialize the tx bd. assume the tx data buffer is at $00002000 in main memory
serial management controllers (smcs) motorola mc68360 user? manual 7-291 and contains five 8-bit characters. write $b000 to tx_bd_status. write $0005 to tx_bd_length. write $00002000 to tx_bd_pointer. 14. write $ff to the smce to clear any previous events. 15. write $17 to the smcm to enable all possible smc interrupts. 16. write $00000010 to the cimr to allow smc1 to generate a system interrupt. (the cicr should also be initialized.) 17. write $4820 to smcmr to configure normal operation (not loopback), 8-bit characters, no parity, 1 stop bit. notice that the transmitter and receiver have not been enabled yet. 18. write $4823 to smcmr to enable the smc transmitter and receiver. this additional write ensures that the ten and ren bits will be enabled last. note after 5 bytes have been transmitted, the tx bd is closed. addi- tionally, the receive buffer is closed after 16 bytes have been re- ceived. any additional receive data beyond 16 bytes will cause a busy (out-of-buffers) condition since only one rx bd was pre- pared. 7.11.9 smc interrupt handling the following list describes what would normally occur within an interrupt handler for the smc: 1. once an interrupt occurs, read the smce to see which sources have caused inter- rupts. the smce bits would normally be cleared at this time. 2. process the tx bd to reuse it if the tx bit was set in smce. extract data from the rx bd if the rx bit was set in smce. to transmit another buffer, simply set the tx bd r- bit. 3. clear the smc1 bit in the cisr. 4. execute the rte instruction. 7.11.10 smc as a transparent controller the following paragraphs describe using the smc as a transparent controller. 7.11.10.1 smc transparent controller key features. the smc transparent controller contains the following key features: flexible data buffers may be used to connect to a tdm bus using the tsa in the si may transmit and receive transparently on its own set of pins using a sync pin to synchronize the beginning of transmission and reception to an external event programmable character length (4?6) reverse data mode
serial management controllers (smcs) 7-292 mc68360 user? manual motorola continuous transmission and reception modes four commands 7.11.10.2 smc transparent comparison. as compared to the transparent modes supported by the sccs, the smcs offer less functionality. this fits with their purpose of pro- viding simpler functions and slower speeds. the smc transparent controller does not sup- port the following features: independent transmit and receive clocks unless connected to a tdm channel of the si crc generation and checking full rts , cts , and cd pins?upports one smsyn pin only ability to transmit data on demand using the todr receiver/transmitter in transparent mode while receiver/transmitter executes an- other protocol 4-, 8-, or 16-bit sync recognition internal dpll support other features for the sccs as described in the gsmr the smcs in transparent mode, however, do provide one feature not provided by the regular sccs. the smcs allow a data character length option of 4 to 16 bits; whereas, the sccs provide a data character length of just 8 or 32 bits (determined by the rfw bit in the gsmr). 7.11.10.3 smc transparent memory map. there is no protocol-specific parameter ram for the smc when it is used as a transparent controller. only the general smc param- eter ram is used, which is discussed in 7.11.4 smc parameter ram. 7.11.10.4 smc transparent transmission processing. the transparent trans- mitter is designed to work with almost no intervention from the cpu32+ core. when the cpu32+ enables the smc transmitter in transparent mode, it will start transmitting idles. the smc immediately polls the first bd in the transmit channel? bd ring, and thereafter once every character time, depending on the character length (i.e., every 4 to 16 serial clocks). when there is a message to transmit, the smc controller will fetch the data from memory and start transmitting the message once synchronization is achieved. table 7-14. smc transparent-specific parameter ram address name width description smc base + 28 reserved word reserved smc base + 2a reserved word reserved smc base + 2c reserved word reserved smc base + 2e reserved word reserved smc base + 30 reserved word reserved
serial management controllers (smcs) motorola mc68360 user? manual 7-293 synchronization can be achieved in two ways. when the transmitter is connected to a tdm channel, it can be synchronized to a time slot. once the frame sync is received, the trans- mitter waits for the first bit of its time slot to occur before transmission begins. data will only be transmitted during the time slots defined by the tsa. secondly, when working with its own set of pins (nonmultiplexed mode), the transmitter will start transmission when the smsynx line is asserted (falling edge). when a bd? data has been completely written to the transmit fifo, the l-bit is checked. if the l-bit is set, the smc writes the message status bits into the bd and clears the r-bit. it will then start transmitting idles. when the end of the current bd has been reached and the l-bit is not set (multibuffer mode), only the r-bit is cleared. in both cases, an interrupt is issued according to the i-bit in the bd. by appropriately setting the i-bit in each bd, inter- rupts can be generated after the transmission of each buffer, a specific buffer, or each block. the smc will then proceed to the next bd in the table. if no additional buffers have been presented to the smc for transmission and the l-bit was cleared, an underrun is detected, and the smc begins transmitting idles. if the cm bit is set in the tx bd, the r-bit will not be cleared, allowing the associated data buffer to be retransmitted automatically when the cp next accesses this data buffer. for instance, if a single tx bd is initialized with the cm bit set and the w-bit set, the data buffer will be continuously transmitted until the user clears the r-bit of the bd. 7.11.10.5 smc transparent reception processing. when the cpu32+ core enables the smc receiver in transparent mode, it will wait for synchronization before receiv- ing data. once synchronization is achieved, the receiver will transfer the incoming data into memory according to the first rx bd in the ring. synchronization can be achieved in two ways. when the receiver is connected to a tdm channel, it can be synchronized to a time slot. once the frame sync is received, the receiver waits for the first bit of its time slot to occur before reception begins. data will only be received during the time slots defined by the tsa. secondly, when working with its own set of pins (nonmultiplexed mode), the receiver will start reception when the smsynx line is asserted (falling edge). when the data buffer has been filled, the smc clears the e-bit in the bd and generates an interrupt if the i-bit in the bd is set. if the incoming data exceeds the length of the data buffer, the smc will fetch the next bd in the table and, if it is empty, will continue to transfer data to this bd? associated data buffer. if the cm bit is set in the rx bd, the e-bit will not be cleared, allowing the associated data buffer to be overwritten automatically when the cp next accesses this data buffer. 7.11.10.6 using the smsyn x pin for synchronization. the smsynx pin offers a method to synchronize the smc channel externally. this method differs somewhat from the synchronization options available in the sccs and should be studied carefully. see fig- ure 7-78 for an example.
serial management controllers (smcs) 7-294 mc68360 user? manual motorola note regardless of whether the transmitter or receiver uses the sm- synx signal, the smsynx signal must make glitch-free transi- tions from high to low or low to high. glitches on smsynx may cause errant behavior of the smc. once the ren bit is set in smcmr, the first rising edge of smclk that detects the smsynx pin as low causes the smc receiver to achieve synchronization. data will begin to be received (latched) on the same rising edge of smclk that latched smsynx . this will be the first bit of data received. the receiver will never lose synchronization again, regardless of the state of smsynx , until the ren bit is cleared by the user. figure 7-78. synchronization with the smsynx pin once the ten bit is set in smcmr, the first rising edge of smclk that detects the smsynx pin as low causes the smc transmitter to achieve synchronization. the smc transmitter will begin transmitting ones asynchronously from the falling edge of smsynx . after one char- acter of ones is transmitted, if the transmit fifo is loaded (i.e., the tx bd was ready with smrxd smc1 receive data smtxd smsyn smclk ten set here tx fifo loaded appx. here smsyn detected low here smclk smsyn ren set here or enter hunt mode command issued first bit of receive data (lsb) 1's are sent smsyn detected low here smc1 transmit data first bit of first 5-bit transmit character (lsb) notes: 1. smclk is an internal clock derived from an external clkpin or a baud rate generator. 2. this example shows the smc receiver and transmitter enabled separately. if the ren and ten bits were set at the same time, a single falling edge of smsyn would synchronize both. five 1's assume character length equals 5 transmission could begin here if tx fifo not loaded in time five 1's are sent
serial management controllers (smcs) motorola mc68360 user? manual 7-295 data), data will begin to be transmitted on the next falling edge of smclk after one character of ones is transmitted. if the transmit fifo is loaded at some later time, the data will begin transmission after some multiple number of all-ones characters is transmitted. the transmit- ter will never lose synchronization again, regardless of the state of smsynx , until the ten bit is cleared by the user or the enter hunt mode command is issued. if both the ren and ten bits are set in smcmr, the first falling edge of the smsynx pin causes both the transmitter and receiver to achieve synchronization. to re-synchronize the transmitter, the smc transmitter may be disabled and reenabled, and the smsynx pin can be used again to re-synchronize just the transmitter. see 7.11.5 disabling the smcs on the fly for a description of how to safely disable and reenable the smc (simply clearing ten and setting ten may not be sufficient). the receiver may be re-synchronized in a similar fashion. 7.11.10.7 using the tsa for synchronization. the tsa offers a method to syn- chronize the smc channel internally without using the smsynx pin. this behavior is similar to that of the smsynx pin, except that the synchronization event is not the falling edge of the smsynx pin, but rather the first time slot for this smc receiver/transmitter following the frame sync indication. see 7.8 serial interface with time slot assigner for further informa- tion on configuring time slots for the smcs and sccs. the tsa allows the smc receiver and transmitter to be enabled simultaneously, yet syn- chronized separately, a capability not provided by the smsynx pin. see figure 7-79 for an example of synchronization using the tsa.
serial management controllers (smcs) 7-296 mc68360 user? manual motorola figure 7-79. synchronization with the tsa once the ren bit is set in smcmr, the first time slot after frame sync causes the smc receiver to achieve synchronization. data will begin to be received immediately, but only during the defined receive time slots. the receiver will continue to receive data during its defined time slots until the ren bit is cleared by the user. if the enter hunt mode com- mand is executed, the receiver will lose synchronization, close the current buffer, and re- synchronize to the first time slot after the frame sync. once the ten bit is set in smcmr, the smc waits for the transmit fifo to be loaded, before attempting to achieve synchronization. once the transmit fifo is loaded, synchronization and transmission begin on the first bit of the first time slot after the frame sync. idles (ones) are transmitted until data begins transmission. if the smc runs out of transmit buffers and a new transmit buffer is provided later, idles will be transmitted during the gap between data buffers, and data transmission from the later data buffer will begin at the beginning of an smc time slot, but not necessarily the first time slot after the frame sync. thus, if the user wishes to maintain a certain bit alignment begin- ning with the first time slot, the user should always make sure that at least one tx bd is always ready and that no underruns occur. otherwise, the smc transmitter should be dis- abled and reenabled. see 7.11.5 disabling the smcs on the fly for a description of how to tdm rx smc1 smc1 tdm tx smc1 tdm tx sync tdm tx clock smc1 tdm rx sync tdm rx clock after ten is set, transmission begins here if smc runs out of tx buffers and new ones are provided later, transmission begins at the beginning of either time slot after ren is set or after enter hunt mode command, reception begins here
serial management controllers (smcs) motorola mc68360 user? manual 7-297 safely disable and reenable the smc (simply clearing ten and setting ten may not be suf- ficient). 7.11.10.8 smc transparent command set. the following transmit and receive commands are issued to the cr. 7.11.10.8.1 transmit commands. the following paragraphs describe the transparent transmit commands. stop transmit command . after a hardware or software reset and the enabling of the channel in the smc mode register, the channel is in the transmit enable mode and starts polling the first bd in the table. the stop transmit command disables the transmission of frames on the transmit chan- nel. if this command is received by the transparent controller during frame transmission, transmission of that buffer is aborted after the contents of the fifo are transmitted (up to 2 characters). the tbptr is not advanced to the next bd, no new bd is accessed, and no new buffers are transmitted for this channel. the transmitter will send idles until the restart transmit command is given. restart transmit command . the restart transmit command is used to begin or resume transmission from the current tbptr in the channel? tx bd table. when this command is received by the channel, it will start polling the r-bit in this bd. this command is expected by the smc after a stop transmit command and the disabling of the chan- nel in its mode register, or after a transmitter error (underrun) occurs. init tx parameters command. this command initializes all the transmit parameters in this serial channel? parameter ram to their reset state. this command should only be issued when the transmitter is disabled. note that the init tx and rx parameters com- mand may also be used to reset both transmit and receive parameters. 7.11.10.8.2 receive commands. the following paragraphs describe the transparent receive commands. enter hunt mode command . this command forces the smc to close the current receive bd if it is currently being used, and to use the next bd in the list for any subsequent data that is received. if the smc is not in the process of receiving data, the buffer is not closed. additionally, this command causes the receiver to wait for a re-synchronization, before further reception continues. close rx bd command . the close rx bd command is used to force the smc to close the current receive bd if it is currently being used, and to use the next bd in the list for any subsequent data that is received. if the smc is not in the process of receiving data, no action is taken by this command. init rx parameters command . initializes all the receive parameters in this serial chan- nel? parameter ram to their reset state. this command should only be issued when the receiver is disabled. note that the init tx and rx parameters command may also be used to reset both receive and transmit parameters.
serial management controllers (smcs) 7-298 mc68360 user? manual motorola 7.11.10.9 smc transparent error-handling procedure. the smc reports message reception and transmission error conditions using the channel bds and the smc event register. 7.11.10.9.1 transmission error (underrun). when this error occurs, the channel termi- nates buffer transmission, closes the buffer, sets the un bit in the bd, and generates the txe interrupt if it is enabled. the channel resumes transmission after the reception of the restart transmit command. underrun cannot occur between frames. 7.11.10.9.2 reception error (overrun). the smc maintains an internal fifo for receiving data (shift register plus data register). the cp begins programming the sdma channel (if the data buffer is in external memory) when the first character is received into the fifo. if a fifo overrun occurs, the smc writes the received data character to the internal fifo over the previously received character. the previous character and its status bits are lost. fol- lowing this, the channel closes the buffer, sets the ov bit in the bd, and generates the rx interrupt if it is enabled. reception then continues normally. 7.11.10.10 smc transparent mode register (smcmr). the operating mode of an smc is defined by the smcmr. the smcmr is a 16-bit, memory-mapped, read-write register. the register is cleared at reset. the function of bits 7? is common to each smc protocol. the function of bits 15? varies according to the protocol selected by the sm bits. bits 15, 10, 9, 7, 6?eserved clen?haracter length clen is programmed with a value from 3 to 15 to obtain 4 to 16 bits per character. if the character length is less than 8 bits, the msbs of the byte in buffer memory are not used on transmit and are written with zeros on receive. if the character length is more than 8 bits, but less than 16 bits, the msbs of the word in buffer memory will not be used on trans- mit and will be written with zeros on receive. notes the values 0 to 2 should not be written to clen, or erratic be- havior may result. larger character lengths increase the potential performance of the smc channel and lower the performance impact on other channels. for instance, the use of 16-bit characters, rather than 8-bit characters, is encouraged if 16-bit characters are accept- able in the end application. revd?everse data 0 = normal mode 1 = reverse the character bit order; the msb is transmitted first. 1514131211109876543210 clen revd sm dm ten ren
serial management controllers (smcs) motorola mc68360 user? manual 7-299 sm?mc mode 00 = gci or scit support 01 = reserved 10 = uart 11 = totally transparent operation (must be selected for smc transparent operation) dm?iagnostic mode 00 = normal operation 01 = local loopback mode 10 = echo mode 11 = reserved ten?mc transmit enable 0 = smc transmitter disabled 1 = smc transmitter enabled notes once the smc transmit enable bit is cleared, the bit must not be reenabled for at least 3 serial clocks. ren?mc receive enable 0 = smc receiver disabled 1 = smc receiver enabled 7.11.10.11 smc transparent receive buffer descriptor (rx bd). the cp reports information about the received data for each buffer using rx bds. the cp closes the current buffer, generates a maskable interrupt, and starts to receive data into the next buffer after one of the following events: 1. detecting an overrun error 2. detecting a full receive buffer 3. issuing the enter hunt mode command note : entries in boldface must be initialized by the user e?mpty 0 = the data buffer associated with this rx bd has been filled with received data, or data reception has been aborted due to an error condition. the cpu32+ core is free to examine or write to any fields of this rx bd. the cp will not use this bd again while the e-bit remains zero. 1514131211109876543210 offset + 0 e wi cm ov offset + 2 data length offset + 4 rx data buffer pointer offset + 6
serial management controllers (smcs) 7-300 mc68360 user? manual motorola 1 = the data buffer associated with this bd is empty, or reception is currently in progress. this rx bd and its associated receive buffer are owned by the cp. once the e-bit is set, the cpu32+ core should not write any fields of this rx bd. bits 14, 11, 10, 8?, 0?eserved w?rap (final bd in table) 0 = this is not the last bd in the rx bd table. 1 = this is the last bd in the rx bd table. after this buffer has been used, the cp will receive incoming data into the first bd in the table (the bd pointed to by rbase). the number of rx bds in this table is programmable and is determined only by the w-bit and the overall space constraints of the dual-port ram. i?nterrupt 0 = no interrupt is generated after this buffer has been filled. 1 = the rx bit in the event register will be set when this buffer has been completely filled by the cp, indicating the need for the cpu32+ core to process the buffer. the rx bit can cause an interrupt if it is enabled. cm?ontinuous mode 0 = normal operation. 1 = the e-bit is not cleared by the cp after this bd is closed, allowing the associated data buffer to be overwritten automatically when the cp next accesses this bd. however, the e-bit will be cleared if an error occurs during reception, regardless of the cm bit. the following status bit is written by the cp after the received data has been placed into the associated data buffer. ov?verrun a receiver overrun occurred during message reception. data length the data length is the number of octets that the cp has written into this bd? data buffer. it is written only once by the cp as the buffer is closed. note the actual amount of memory allocated for this buffer should be greater than or equal to the contents of the mrblr. rx data buffer pointer the receive buffer pointer, which always points to the first location of the associated data buffer, must be even. the buffer may reside in either internal or external memory. 7.11.10.12 smc transparent transmit buffer descriptor (tx bd). data is presented to the cp for transmission on an smc channel by arranging it in buffers refer- enced by the channel? tx bd table. the cp confirms transmission or indicates error con- ditions using the bds to inform the processor that the buffers have been serviced.
serial management controllers (smcs) motorola mc68360 user? manual 7-301 note : entries in boldface must be initialized by the user r?eady 0 = the data buffer associated with this bd is not ready for transmission. the user is free to manipulate this bd or its associated data buffer. the cp clears this bit after the buffer has been transmitted or after an error condition is encountered. 1 = the data buffer, which has been prepared for transmission by the user, has not been transmitted or is currently being transmitted. no fields of this bd may be writ- ten by the user once this bit is set. bits 14, 10, 8?, 0?eserved w?rap (final bd in table) 0 = this is not the last bd in the tx bd table. 1 = this is the last bd in the tx bd table. after this buffer has been used, the cp will receive incoming data into the first bd in the table (the bd pointed to by tbase). the number of tx bds in this table is programmable and is determined by the w-bit and the overall space constraints of the dual-port ram. i?nterrupt 0 = no interrupt is generated after this buffer has been serviced. 1 = the tx or txe bit in the event register will be set when this buffer has been ser- viced. tx and txe can cause interrupts if they are enabled. l?last in message 0 = the last byte in the buffer is not the last byte in the transmitted transparent frame. data from the next transmit buffer (if ready) will be transmitted immediately follow- ing the last byte of this buffer. 1 = the last byte in this buffer is the last byte in the transmitted transparent frame. after this buffer is transmitted, the transmitter will require synchronization before the next buffer will be transmitted. cm?ontinuous mode 0 = normal operation. 1 = the r-bit is not cleared by the cp after this bd is closed, allowing the associated data buffer to be retransmitted automatically when the cp next accesses this bd. however, the r-bit will be cleared if an error occurs during transmission, regard- less of the cm bit. 1514131211109876543210 offset + 0 r wi l cm un offset + 2 data length offset + 4 tx data buffer pointer offset + 6
serial management controllers (smcs) 7-302 mc68360 user? manual motorola un?nderrun the smc encountered a transmitter underrun condition while transmitting the associated data buffer. data length the data length is the number of octets that the cp should transmit from this bd? data buffer. this value is never modified by the cp. the data length may be even or odd; however, if the number of bits in the transparent character is greater than 8, the data length should be even. example: to transmit three transparent 8-bit characters, the data length field should be initialized to 3. however, to transmit three transparent 9-bit characters, the data length field should be initialized to 6, since the three 9-bit characters occupy three words in memory (the 9 lsbs of each word). tx data buffer pointer the transmit buffer pointer, which always points to the first byte of the associated data buffer, may be even or odd (unless the character length is greater than 8 bits, in which case the transmit buffer pointer must be even). for instance, the pointer to 8-bit transpar- ent characters may be even or odd, but the pointer to 9-bit transparent characters must be even. the buffer may reside in either internal or external memory. 7.11.10.13 smc transparent event register (smce). smce is referred to as the smc transparent event register when the smc is programmed for transparent mode. it is an 8-bit register used to report events recognized by the smc channel and to generate inter- rupts. on recognition of an event, the smc controller sets the corresponding bit in the smce. interrupts generated by this register may be masked in the smc mask register. the smce is a memory-mapped register that may be read at any time. a bit is cleared by writing a one (writing a zero does not affect a bit? value). more than one bit may be cleared at a time. all unmasked bits must be cleared before the cp will clear the internal interrupt request. this register is cleared at reset. bits 7?, 3?eserved txe?x error an underrun error occurred on the transmitter channel. bsy?usy condition a character was received and discarded due to lack of buffers. reception will begin after a new buffer is provided. the user may wish to execute an enter hunt mode com- mand to cause the receiver to wait for re-synchronization. tx?x buffer a buffer has been transmitted. if the l-bit of the tx bd is set, this bit is set when the last data character begins to be transmitted; the user must wait one character time to be sure 76543210 txe bsy tx rx
serial management controllers (smcs) motorola mc68360 user? manual 7-303 that the data was completely sent over the transmit pin. if the l-bit of the tx bd is cleared, this bit is set when the last data character is written to the transmit fifo; the user must wait two character times to be sure that the data was completely sent over the transmit pin. rx?x buffer a buffer has been received on the smc channel and its associated rx bd is now closed. this bit is set after the last character was written to the buffer. 7.11.10.14 smc transparent mask register (smcm). the smcm is referred to as the smc transparent mask register when the smc is operating in transparent mode. it is an 8-bit read-write register that has the same bit format as the transparent event register. if a bit in the smcm is a one, the corresponding interrupt in the transparent event register will be enabled. if the bit is zero, the corresponding interrupt in the transparent event register will be masked. this register is cleared upon reset. 7.11.11 smc transparent nmsi example the following list is an initialization sequence for operation of the smc1 transparent channel over its own set of pins. the transmit and receive clocks are provided from the clk3 pin (no baud rate generator is used), and the smsynx pin is used to obtain synchronization. (the smc uart example shows an example of configuring the baud rate generator.) 1. the sdcr (sdma configuration register) should be initialized to $0740, rather than being left at its default value of $0000. 2. configure the port b pins to enable the smtxd1, smrxd1, and smsyn1. write pbpar bits 6, 7, and 8 with ones. write pbdir bits 6, 7, and 8 with zeros. write pbodr bits 6, 7, and 8 with zeros. 3. configure the port a pins to enable clk3. write pbpar bit 10 and padir bit 10 with a one. write pbdir bit 10 with a zero. the other functions of this pin are the timers or the tsa. these alternate functions cannot be used on this pin. 4. connect the clk3 clock to smc1 using the si. write the smc1 bit in simode with a 0. write the smc1cs bits in simode with 110. 5. write rbase and tbase in the smc parameter ram to point to the rx bd and tx bd in the dual-port ram. assuming one rx bd at the beginning of dual-port ram and one tx bd following that rx bd, write rbase with $0000 and tbase with $0008. 6. program the cr to execute the init rx & tx params command for this channel." for instance, to execute this command for scc1, write $0001 to the cr. this com- mand causes the rbptr and tbptr parameters of the serial channel to be updated with the new values just programmed into rbase and tbase. 7. write rfcr with $18 and tfcr with $18 for normal operation. 8. write mrblr with the maximum number of bytes per receive buffer. for this case, assume 16 bytes, so mrblr = $0010. 9. initialize the rx bd. assume the rx data buffer is at $00001000 in main memory.
serial management controllers (smcs) 7-304 mc68360 user? manual motorola write $b000 to rx_bd_status. write $0000 to rx_bd_length (not required?one for instructional purposes only). write $00001000 to rx_bd_pointer. 10. initialize the tx bd. assume the tx data buffer is at $00002000 in main memory and contains five 8-bit characters. write $b000 to tx_bd_status. write $0005 to tx_bd_length. write $00002000 to tx_bd_pointer. 11. write $ff to the smce to clear any previous events. 12. write $13 to the smcm to enable all possible smc interrupts. 13. write $00000010 to the cimr to allow smc1 to generate a system interrupt. (the cicr should also be initialized.) 14. write $3830 to smcmr to configure 8-bit characters, non-reversed data, and normal operation (not loopback). notice that the transmitter and receiver have not been enabled yet. 15. write $3833 to smcmr to enable the smc transmitter and receiver. this additional write ensures that the ten and ren bits will be enabled last. note after 5 bytes have been transmitted, the tx bd is closed. addi- tionally, the receive buffer is closed after 16 bytes have been re- ceived. any additional receive data beyond 16 bytes will cause a busy (out-of-buffers) condition since only one rx bd was pre- pared. 7.11.12 smc transparent tsa example the following list is an initialization sequence for operation of the smc1 transparent channel over the tsa. it is assumed that the tsa and the tdm pins already have been set up to route time slot data to the smc transmitter and receiver. (7.8 serial interface with time slot assigner shows examples of how to configure the tsa.) the transmit and receive clocks and synchronization signals are provided internally from the tsa. 1. write rbase and tbase in the smc parameter ram to point to the rx bd and tx bd in the dual-port ram. assuming one rx bd at the beginning of dual-port ram and one tx bd following that rx bd, write rbase with $0000 and tbase with $0008. 2. program the cr to execute the init rx & tx params command for this channel." for instance, to execute this command for scc1, write $0001 to the cr. this com- mand causes the rbptr and tbptr parameters of the serial channel to be updated with the new values just programmed into rbase and tbase. 3. write rfcr with $18 and tfcr with $18 for normal operation. 4. write mrblr with the maximum number of bytes per receive buffer. for this case,assume 16 bytes, so mrblr = $0010. 5. initialize the rx bd. assume the rx data buffer is at $00001000 in main memory. write $b000 to rx_bd_status. write $0000 to rx_bd_length (not required?one for instructional purposes only). write $00001000 to rx_bd_pointer. 6. initialize the tx bd. assume the tx data buffer is at $00002000 in main memory and
serial management controllers (smcs) motorola mc68360 user? manual 7-305 contains five 8-bit characters. write $b000 to tx_bd_status. write $0005 to tx_bd_length. write $00002000 to tx_bd_pointer. 7. write $ff to the smce to clear any previous events. 8. write $13 to the smcm to enable all possible smc interrupts. 9. write $00000010 to the cimr to allow smc1 to generate a system interrupt. (the cicr should also be initialized.) 10. write $3830 to smcmr to configure 8-bit characters, non-reversed data, and normal operation (not loopback). notice that the transmitter and receiver have not been enabled yet. 11. write $3833 to smcmr to enable the smc transmitter and receiver. this additional write ensures that the ten and ren bits will be enabled last. note after 5 bytes have been transmitted, the tx bd is closed. addi- tionally, the receive buffer is closed after 16 bytes have been re- ceived. any additional receive data beyond 16 bytes will cause a busy (out-of-buffers) condition since only one rx bd was pre- pared. 7.11.13 smc interrupt handling the following list describes what would normally occur within an interrupt handler for the smc. 1. once an interrupt occurs, read the smce to see which sources have caused inter- rupts. the smce bits would normally be cleared at this time. 2. process the tx bd to reuse it if the tx bit was set in smce. extract data from the rx bd if the rx bit was set in smce. to transmit another buffer, simply set the tx bd r- bit. 3. clear the smc1 bit in the cisr. 4. execute the rte instruction. 7.11.14 smc as a gci controller the smc can be used to control the c/i and to monitor channels of the gci frame. when using the scit configuration of gci, one smc can handle scit channel 0, and the other smc can handle scit channel 1. the main features are as follows: each smc channel supports the c/i and monitor channels of the gci (iom-2) in isdn applications two smcs support the two sets of c/i and monitor channels in scit channel 0 and channel 1 full-duplex operation local loopback and echo capability for testing
serial management controllers (smcs) 7-306 mc68360 user? manual motorola note the smcs on the quicc differ from the smcs on the mc68302. on the quicc, a single smc handles both the monitor and c/i fields of a gci channel. on the mc68302, one smc handles the monitor field, and another smc is required for the c/i field. ad- ditionally, the mc68302 cannot use scit channel 1; whereas, the quicc can. to use the smc gci channels properly, the tsa in the si must be configured to route the monitor and c/i channels to the desired smc. see 7.8 serial interface with time slot assigner for more details on how to program this configuration. the following smc discus- sion assumes that this time-slot routing is programmed properly. 7.11.14.1 smc gci memory map. the gci parameter ram area begins at the same off- set from each smc base area. the smc gci mode has a very different set of parameter ram than the smc uart or smc transparent modes. in the smc gci mode, the general-purpose parameter ram contains the bds, rather than pointers to the bds. contrast table 7-15 with table 7-12 to see these differences. additionally, the smc in gci mode contains no protocol-specific parameter ram. notes: rstate, m_rxd, m_txd, ci_rxd, and ci_txd do not need to be accessed by the user in normal operation, and are reserved areas for risc use only. 7.11.14.1.1 smc monitor channel transmission. the monitor channel 0 is used for data exchange with a layer 1 device (e.g., reading and writing internal registers and transferring of the s and q bits). the monitor channel 1 is used for programming and controlling voice/ data modules such as codecs. table 7-15. smc gci parameter ram address name width description smc base + 00 m_rxbd word monitor channel rx bd smc base + 02 m_txbd word monitor channel tx bd smc base + 04 ci_rxbd word c/i channel rx bd smc base + 06 ci_txbd word c/i channel tx bd smc base + 08 rstate long rx & tx internal state smc base + 0c m_rxd word monitor rx data smc base + 0e m_txd word monitor tx data smc base + 10 ci_rxd word c/i rx data smc base + 12 ci_txd word c/i tx data
serial management controllers (smcs) motorola mc68360 user? manual 7-307 the cpu32+ core writes the data byte into the smc tx bd. the smc will transmit the data on the monitor channel. the smc transmitter can be programmed to work in one of two modes: monitor channel protocol in this mode, the smc transmits the data and handles the a and e control bits according to the gci monitor channel protocol. when using the monitor channel protocol, the user may issue the timeout command to solve deadlocks in case of errors in the a and e bit states on the data line. 7.11.14.1.2 smc monitor channel reception. the smc receiver can be programmed to work in one of two modes: monitor channel protocol in this mode, the smc receives the data and handles the a and e control bits according to the gci monitor channel protocol. when a received data byte is stored by the cp in the smc rx bd, a maskable interrupt is generated. when using the monitor channel protocol, the user may issue the transmit abort request command. the quicc will then transmit an abort request on the e-bit. 7.11.14.2 smc c/i channel handling. the c/i channel (in scit configuration, c/i channel 0) is used to control the layer 1 device. the layer 2 device in the te sends com- mands and receives indication to/from the upstream layer 1 device via c/i channel 0. in the scit configuration, c/i channel 1 is used to convey real-time status information between the layer 2 device and nonlayer 1 peripheral devices (e.g., codecs). 7.11.14.2.1 smc c/i channel transmission. the cpu32+ core writes the data byte into the smc c/i tx bd. the smc will transmit the data continuously on the c/i channel to the physical layer device. 7.11.14.2.2 smc c/i channel reception. the smc receiver continuously monitors the c/ i channel. when a change in the data is recognized and this value is received in two suc- cessive frames, it will be interpreted as valid data. this is referred to as the double last-look method. the received data byte is stored by the cp in the c/i rx bd, and a maskable inter- rupt is generated. if the smc is configured to support scit channel 1, the double last-look method is not used. 7.11.14.3 smc commands in gci mode. the following commands are issued to the cr. init tx and rx parameters command . this command initializes the transmit and receive parameters in the parameter ram to their reset state. this command is especially useful when switching protocols on a given serial channel. transmit abort request command . this receiver command may be issued when the quicc implements the monitor channel protocol. when issued, the quicc sends an abort request on the a-bit.
serial management controllers (smcs) 7-308 mc68360 user? manual motorola timeout command . this transmitter command may be issued when the quicc imple- ments the monitor channel protocol. it is issued because the device is not responding or because gci a-bit errors are detected. when issued, the quicc sends an abort request on the e-bit. 7.11.14.4 smc gci mode register (smcmr). the operating mode of an smc is defined by the smcmr. the smcmr is a 16-bit, memory-mapped, read-write register. the register is cleared at reset. the functions of bits 7? are common to each smc protocol. the functions of bits 15? vary according to the protocol selected by the sm bits. bit 15, 9, 7, 6?eserved these bits should be cleared by the user. clen?haracter length this value is used to define the total number of bits in the c/i and monitor channels of the scit channel 0 or channel 1. clen ranges from 0 to 15 and specifies values from 1 to 16 bits. clen should be written with 13 for the scit channel 0 or gci (8 data bits, plus a and e bits, plus 4 c/i bits = 14 bits). clen should be written with 15 for the scit channel 1 (8 data, bits, plus a and e bits, plus 6 c/i bits = 16 bits). me?onitor enable 0 = the smc does not support the monitor channel. 1 = the smc supports the monitor channel with either the transparent or monitor chan- nel protocol as defined in the mp bit. c#?cit channel number 0 = scit channel 0 1 = scit channel 1 (required for siemens arcofi and sgs s/t chips) sm?mc mode 00 = gci or scit support (required for smc gci or scit operation) 01 = reserved 10 = uart 11 = totally transparent operation dm?iagnostic mode 00 =normal operation 01 =local loopback mode 10 = echo mode 11 = reserved ten?mc transmit enable 0 = smc transmitter disabled 1 = smc transmitter enabled 1514131211109876543210 clen me c# sm dm ten ren
serial management controllers (smcs) motorola mc68360 user? manual 7-309 ren?mc receive enable 0 = smc receiver disabled 1 = smc receiver enabled 7.11.14.5 smc monitor channel rx bd. the cp reports information about the moni- tor channel receive byte using this bd. e?mpty 0 = this bit is cleared by the cp to indicate that data byte associated with this bd is now available to the cpu32+ core. 1 = this bit is set by the cpu32+ core to indicate that the data byte associated with this bd has been read. when the smc implements the monitor channel protocol, the smc will wait until this bit is set by the cpu32+ core before acknowledging the monitor channel data. in the trans- parent mode, additional received data bytes will be discarded until the e-bit is set by the cpu32+ core. l?ast (eom) this bit is valid only when the smc implements the monitor channel protocol. this bit is set when the end-of-message (eom) indication is received on the e-bit. note when this bit is set, the data byte is not valid. er?rror condition this bit is valid only when the smc implements the monitor channel protocol. this bit is set when an error condition occurs on the monitor channel protocol. (a new byte is trans- mitted before the smc acknowledges the previous byte.) ms?ata mismatch this bit is valid only when the smc implements the monitor channel protocol. this bit is set when two different consecutive bytes are received and is cleared when the last two consecutive bytes match. the smc waits for the reception of two identical consecutive bytes before writing new data to the rx bd. bits 11?0?eserved these bits should be cleared by the user. data?ata field the data field contains the monitor channel data byte received by the smc. 1514131211109876543210 e l er ms data
serial management controllers (smcs) 7-310 mc68360 user? manual motorola 7.11.14.6 smc monitor channel tx bd. the cp reports the information about the monitor channel transmit byte using this bd. r?eady 0 = this bit is cleared by the cp after transmission. the tx bd is now available to the cpu32+ core. 1 = this bit is set by the cpu32+ core to indicate that the data byte associated with this bd is ready for transmission. l?ast (eom) this bit is valid only when the smc implements the monitor channel protocol. when this bit is set, the smc will first transmit the buffer? data and then transmit the end-of-mes- sage (eom) indication on the e-bit. ar?bort request this bit is valid only when the smc implements the monitor channel protocol. this bit is set by the smc when an abort request is received on the a-bit. the smc transmitter will transmit the eom on the e-bit after an abort request is received. bits 12?0?eserved these bits should be cleared by the user. data?ata field the data field contains the data to be transmitted by the smc on the monitor channel. 7.11.14.7 smc c/i channel receive buffer descriptor (rx bd). the cp reports information about the c/i channel receive byte using this bd. e?mpty 0 = this bit is cleared by the cp to indicate that data byte associated with this bd is now available to the cpu32+ core. 1 = this bit is set by the cpu32+ core to indicate that the data byte associated with this bd has been read. note additional data received will be discarded until the e-bit is set. bits 14?,1-0?eserved these bits should be cleared by the user. 1514131211109876543210 r l ar data 1514131211109876543210 e c/i data
serial management controllers (smcs) motorola mc68360 user? manual 7-311 c/i data?ommand/indication data bits c/i data is a 4-bit data field for c/i channel 0 and a 6-bit data field for c/i channel 1. it contains the data received from the c/i channel. for c/i channel 0, bits 5-2 contain the 4- bit data field, and bits 7 and 6 are always written with zeros. for c/i channel 1, bits 7-2 contain the 6-bit data field.. 7.11.14.8 smc c/i channel transmit buffer descriptor (tx bd). the cp reports information about the c/i channel transmit byte using the bd. r?eady 0 = this bit is cleared by the cp after transmission to indicate that the bd is now avail- able to the cpu32+ core. 1 = this bit is set by the cpu32+ core to indicate that the data associated with this bd is ready for transmission. bits 14??eserved these bits should be cleared by the user. c/i data?ommand/indication data bits c/i data is a 4-bit data field for c/i channel 0 and a 6-bit data field for c/i channel 1. it contains the data to be transmitted onto the c/i channel. for c/i channel 0, bits 5-2 con- tain the 4-bit data field, and bits 7 and 6 are always written with zeros. for c/i channel 1, bits 7-2 contain the 6-bit data field. 7.11.14.9 smc event register (smce). the smce is an 8-bit register used to report events recognized by the smc channel and to generate interrupts. on recognition of event, the smc sets its corresponding bit in this register. interrupts generated by this register may be masked in the smc mode register. the smce is a memory-mapped register that may be read at any time. a bit is cleared by writing a one (writing a zero does not affect a bit? value). more than one bit may be cleared at a time. all unmasked bits must be cleared before the cp will clear the internal interrupt request to the cpm interrupt controller. this register is cleared at reset. bits 7??eserved ctxb?/i channel buffer transmitted the c/i transmit buffer became empty. 1514131211109876543210 r c/i data 76543210 ctxb crxb mtxb mrxb initial value: 0000
serial peripheral interface (spi) 7-312 mc68360 user? manual motorola crxb?/i channel buffer received the c/i receive buffer is full. mtxb?onitor channel buffer transmitted the monitor transmit buffer became empty. mrxb?onitor channel buffer received the monitor receive buffer is full. 7.11.14.10 smc mask register (smcm). the smcm is an 8-bit, memory-mapped, read-write register. it has the same bit format as the smc event register. if a bit in the smcm is a one, the corresponding interrupt in the smc event register will be enabled. if the bit is zero, the corresponding interrupt in the smc event register will be masked. the smcm is clear upon reset. 7.12 serial peripheral interface (spi) the spi allows the quicc to exchange data between other quicc chips, the mc68302, the m68hc11 and m68hc05 microcontroller families, and a number of peripheral devices such as eeproms, real-time clock devices, a/d converters, and isdn devices. 7.12.1 overview the spi is a full-duplex, synchronous, character-oriented channel that supports a four-wire interface (receive, transmit, clock, and slave select). the spi block consists of transmitter and receiver sections, an independent baud rate gen- erator, and a control unit. the transmitter and receiver sections use the same clock, which is derived from the spi baud rate generator in master mode and generated externally in slave mode. during an spi transfer, data is transmitted and received simultaneously. refer to figure 7-80 for the spi block diagram.
serial peripheral interface (spi) motorola mc68360 user? manual 7-313 figure 7-80. spi block diagram note the spi is a superset of the mc68302 serial communications port (scp). the spi receiver and transmitter are double-buffered as shown in the block diagram. this corresponds to an effective fifo size (latency) of 2 characters. note that the lsb of the spi is labeled as data bit 0 on the serial line; whereas, other devices, such as the mc145554 codec, may label the msb as data bit 0. the quicc spi bit 7 (msb) is shifted out first. when the spi is not enabled in the spmode, it consumes minimal power. 7.12.2 spi key features the spi contains the following key features: four-wire interface (spimosi, spimiso, spiclk, and spisel ) full-duplex operation works with data characters from 4 to 16 bits in length supports back-to-back character transmission and reception master or slave spi modes supported transmit_reg receive_reg shift_register counter pins interface spi mode reg peripheral bus imb spi brg spisel spimosi spimiso spiclk in_clk rxd txd brgclk
serial peripheral interface (spi) 7-314 mc68360 user? manual motorola multi-master environment support continuous transfer mode for auto scanning of a peripheral supports clock rates up to 6.25 mhz in master mode and up to 12.5 mhz in slave mode (assuming a 25-mhz system clock) independent programmable baud rate generator programmable clock phase and polarity open-drain output pins support multi-master configuration local loopback capability for testing 7.12.3 spi clocking and pin functions the spi can be configured as a master for the serial channel, meaning that it generates both the enable and clock signals, or as slave, meaning that the enable and clock signals are inputs to the spi. the spi also supports operation in a multi-master environment. when the spi is a master, the spi baud rate generator is used to generate the spi transmit and receive clocks. the spi baud rate generator takes its input from the brgclk. the brgclk is generated in the clock synthesizer of the quicc specifically for the spi baud rate generator and the other four baud rate generators in the cpm. brgclk defaults to the system frequency (25 mhz). however, the clock synthesizer in the sim60 has an option to divide the brgclk by 1, 4, 16, or 64 before it leaves the clock synthesizer. what- ever the resulting frequency of brgclk, the user may use that brgclk frequency as the input to the spi baud rate generator. note user should note the maximum clock rate dose not equal maxi- mum data rate. see appendix a serial performance for more detail. the ability to reduce the frequency of brgclk before it leaves the clock synthesizer is use- ful for two reasons. first, in a low-power mode, the baud rate generator clocking could be a significant factor in overall quicc power consumption. thus, if none of the quicc baud rate generators need to generate high frequencies nor require a high resolution in the user application, a lower frequency brgclk may be input to the baud rate generators. secondly, the user may wish to dynamically change the general system clock frequency in the clock synthesizer (slow go mode), while still having the baud rate generator run at the original frequency. the brgclk allows this option also. the spi master-in slave-out (spimiso) pin is an input in master mode and an output in slave mode. the spi master-out slave-in (spimosi) pin is an output in master mode and an input in slave mode. the reason the pins names spimosi and spimiso change func- tionality between master and slave mode is to support a multi-master configuration that allows communication from any spi to any other spi with the same hardware configuration.
serial peripheral interface (spi) motorola mc68360 user? manual 7-315 when the spi is working as a master, spiclk is the clock output signal that shifts in the received data from the spimiso pin and shifts out the transmitted data to the spimosi pin. additionally, an spi master device must provide a slave select signal output to enable the spi slave devices. this may be implemented using one of the quicc? general-purpose i/ o pins. the spisel pin should not be asserted while the spi is working as a master, or the spi will indicate an error. when the spi is working as a slave, spiclk is the clock input signal that shifts in the received data from the spimosi pin and shifts out the transmitted data to the spimiso pin. the spisel pin provided by the quicc is the enable input to the spi slave. when the spi is working in a multi-master environment, the spisel pin is still an input and is used to detect an error condition when more then one master is operating. spiclk is a gated clock (i.e., the clock only toggles while data is being transferred). the user can select any of four combinations of spiclk phase and polarity using two bits in the spi mode register (spmode). the spi pins can also be configured as open-drain pins to support a multi-master configu- ration where the same spi pin can be driven by the quicc or an external spi device. 7.12.4 spi transmit/receive process the following paragraphs discuss spi master, slave, and multi-master operation. 7.12.4.1 spi master mode. when the spi functions in master mode, the spi transmits a message to the peripheral (spi slave), which in turn sends back a simultaneous reply. when the quicc works with more than one slave, it can use the general-purpose parallel i/o pins to selectively enable different slaves. to begin the data exchange, the cpu32+ core writes the data to be transmitted into a data buffer, configures a tx bd with its r-bit set and configures one or more rx bds. the cpu32+ core should then set the str bit in the spcom to start transmission of data. the data will begin transmission once the sdma channel has loaded the transmit fifo with data. the spi controller then generates programmable clock pulses on the spiclk pin for each character and shifts the data out on the spimosi pin. at the same time, the spi shifts receive data in from the spimiso pin. this receive data is written into a receive buffer using the next available rx bd. the spi will continue transmitting and receiving characters until the transmit buffer has been completely transmitted or an error has occurred (spisel pin unexpectedly asserted). the cp then clears the r and e bits in the tx bd and rx bd, and issues a maskable interrupt to the cpm interrupt controller. when multiple tx bds are ready for transmission, the tx bd l-bit determines whether the spi continues to transmit without waiting for the str bit to be set again. if the l-bit is cleared, the data from the next tx bd will begin its transmission following the transmission of data from the first tx bd. in most cases, the user should see no delay on the spimosi pin between buffers. if the l-bit is set, transmission will cease after data from this tx bd has
serial peripheral interface (spi) 7-316 mc68360 user? manual motorola completed transmission. in addition, the current rx bd that is used to receive data is closed after the transmission completes, even if the receive buffer is not full. thus, the user does not need to provide receive buffers of the same length as the transmit buffers. if the spi is the only master in a system, then the spisel pin can be used as a general- purpose i/o, and the internal spisel signal to the spi will always be forced inactive inter- nally, eliminating the possibility of a multi-master error. 7.12.4.2 spi slave mode. when the spi functions in slave mode, the spi receives mes- sages from an spi master and, in turn, sends back a simultaneous reply. the spisel pin must be asserted before receive clocks will be recognized. once spisel is asserted, the spiclk pin becomes an input from the master to the slave. spiclk may be any frequency from dc to the brgclk/2 (i.e., 12.5 mhz for a 25-mhz system). before the data exchange, the cpu32+ core writes the data to be transmitted into a data buffer, configures a tx bd with its r-bit set, and configures one or more rx bds. the cpu32+ core should then set the str bit in the spcom to enable the spi to prepare the data for transmission and wait for the spisel pin to be asserted. data is shifted out from the slave on the spimiso pin and shifted in through the spimosi pin. a maskable interrupt is issued upon complete transmission or reception of a full buffer or after an error has occurred (receive overrun, transmit underrun, out of receive buffers, etc.). the spi will then continue reception using the next rx bd in the ring until it runs out of receive buffers or the spisel pin is negated. transmission will continue until no more data is available to be transmitted or the spisel pin is negated. if the spisel pin is negated prior to all the transmit data being transmitted, transmission will cease, but the tx bd will remain open. further transmission from that point will continue once the spisel pin is reasserted and spiclk begins toggling. after complet- ing transmission of characters in the tx db, the spi will transmit ones if spisel is not negated. 7.12.4.3 spi multi-master operation. the spi can operate in a multi-master envi- ronment in which some spi devices are connected on the same bus. in this configuration, the spimosi, spimiso, and spiclk pins of all spis are connected together, and the spisel input pins are connected separately. in this environment, only one spi device can work as a master at a time; all the others must be slaves. when the spi is configured as a master and its spisel input goes active (low), a multi-master error has occurred since more than one spi device is currently a bus master. the spi sets the mme bit in the event regis- ter, and a maskable interrupt is issued to the cpu32+ core. it also disables the spi opera- tion and the output drivers of the spi pins. the cpu32+ core should clear the en bit the spmode before using the spi again. after the problems are corrected, the mme bit should be cleared, and the spi should be enabled with the same procedure as after a reset. note: the user should note the maximum data rate supported on the spi is 500kbps. the spi can transfer a single character at much
serial peripheral interface (spi) motorola mc68360 user? manual 7-317 higher rates (6.25mhz in master mode and 12.5mhz in slave mode). if multiple characters are to be transferred, a gap should be inserted between transmission so that it will not exceed the maximum data rate. 7.12.5 spi programming model the following paragraphs describe the registers in the spi. 7.12.5.1 spi mode register (spmode). spmode is a read-write register that controls both the spi operation mode and the spi clock source. spmode is cleared by reset. bit 15?eserved this bit should be cleared by the user. loop?oop mode when set, this bit selects the local loopback operation. the transmitter output is internally connected to the receiver input; the receiver and transmitter operate normally except that the received data is ignored. (loopback mode does not invert the spi data, as do some spi-type devices such as the mc68302.) 0 = normal operation. 1 = the spi is in loopback mode. ci?lock invert the ci bit inverts the spi clock polarity (refer to figure 7-81 and figure 7-82). 0 = the inactive state of spiclk is low. 1 = the inactive state of spiclk is high. cp?lock phase the cp bit selects one of two fundamentally different transfer formats (refer to figure 7- 81 and figure 7-82). 0 = spiclk begins toggling at the middle of the data transfer. 1 = spiclk begins toggling at the beginning of the data transfer. div16?ivide by 16 the div16 bit selects the clock source for the spi baud rate generator when configured as an spi master. in slave mode, the clock source is the spiclk pin. 0 = use the brgclk as the input to the spi baud rate generator. 1 = use the brgclk/16 as the input to the spi baud rate generator. rev?everse data the rev bit determines the receive and transmit character bit order. 0= reverse data?sb of character transmitted and received first. 1= normal operation?sb of character transmitted and received first. 1514131211109876543210 loop ci cp div16 rev m/ s en len pm3 pm2 pm1 pm0
serial peripheral interface (spi) 7-318 mc68360 user? manual motorola m/s ?aster/slave the m/s bit configures the spi to work as a master or a slave. 0 = spi is a slave. 1 = spi is a master. en?nable spi the en bit enables the spi operation. note that spimosi, spimiso, spiclk, and spisel should be configured to connect to the spi as described in 7.14.7 port b regis- ters. when the en bit is cleared, the spi is in a reset state and consumes minimal pow- er?he spi baud rate generator is not functioning and the input clock is disabled. 0 = spi is disabled. 1 = spi is enabled. note other bits of the spmode should not be modified by the user while en is set. len?haracter length the len field specifies how many bits are in a character. the value 0000 corresponds to 1 bit, and the value 1111 corresponds to 16 bits. acceptable values are in the range of 4 to 16 bits inclusive. programming a value less than 4 bits may cause erratic behavior. if the len value is less than or equal to a byte, there will be len number of valid bits in every byte (8 bits) in memory. if the len value is greater than a byte, there will be len number of valid bits in every word (16 bits) in memory (see the following example). pm3?m0?rescale modulus select these four bits specify the divide ratio of the prescale divider in the spi clock generator. the brgclk is divided by 4 * ([pm3?m0] + 1) giving a clock divide ratio of 4 to 64. the clock has a 50% duty cycle. spi examples with different len values these examples use len to illustrate using the bits described above.to help map the pro- cess, let g through v be binary symbols, x indicates a deleted bit, __ indicates original byte boundaries, and _ indicates original nybble (4-bit) boundaries - both are used to aid read- ability and to help understand the process. once the data string image is determined, it is always transmitted byte by byte with the lsb first. let the memory contain the following binary image: msb ghij_klmn __opqr_stuv lsb example 1: with len=4 (data size=5), the following data is selected: msb xxxj_klmn__xxxr_stuv lsb with rev=0, the data string image is: msb j_klmn__r_stuv lsb the order of the string appearing on the line, a byte at a time is: nmlk_j__vuts_r with rev=1, the string has each byte reversed the data string image is: msb nmlk_j__vuts_r lsb
serial peripheral interface (spi) motorola mc68360 user? manual 7-319 the order of the string appearing on the line, a byte at a time is: j_klmn__r_stuv example 2: with len=7 (data size=8), the following data is selected: msb ghij_klmn__opqr_stuv lsb the data string selected is: msb ghij_klmn__opqr_stuv lsb with rev=0, the string transmitted, a byte at a time, with lsb first is: nmlk_jihg__vuts_rqpo with rev=1, the string is byte reversed and transmitted, a byte at a time, with lsb first: ghij_klmn__opqr_stuv example 3: with len=0ch(12), (data size=0dh(13)), the following data is selected: msb ghij_klmn__xxxr_stuv lsb the data string selected is: msb r_stuv__ghij_klmn lsb with rev=0, the string transmitted, a byte at a time, with lsb first is: vuts_r__nmlk_jihg with rev=1, the string is word reversed nmlk_jihg__vuts_r and transmitted, a byte at a time, with lsb first: ghij_klmn__r_stuv figure 7-81. spi transfer format with cp = 0 figure 7-82. spi transfer format with cp = 1 spiclk (ci = 0) spiclk (ci = 1) spimosi (from master) spimiso (from slave) spisel msb lsb msb lsb q note: q = undefined signal spiclk (ci = 0) spiclk (ci = 1) spimosi (from master) spimiso (from slave) spisel msb msb lsb lsb q note: q = undefined signal
serial peripheral interface (spi) 7-320 mc68360 user? manual motorola 7.12.5.2 spi command register (spcom). the spcom is an 8-bit read-write register that is used to start spi operation. bits 6??eserved. these bits should be written with zeros by the user. str?tart transmit when the spi is configured as a master, setting the str bit to one causes the spi con- troller to start the transmission and reception of data from/to the spi transmit/receive buff- ers (if they are configured as ready by the user). when the spi is configured as a slave, setting the str bit to one when the spi is idle (between transfers) causes the spi to load the transmit data register from the spi transmit buffer and start transmission as soon as the next spi input clocks and select signal are received. the str bit is cleared automatically after one system clock cycle. 7.12.5.3 spi parameter ram memory map. the spi parameter ram area (see table 7-16) begins at the spi base address. this area is used for the general spi parame- ters. the user will notice that it is similar to the scc general-purpose parameter ram. note: the items in boldface should be initialized by the user. certain parameter ram values (marked in boldface) need to be initialized by the user before the spi is enabled; other values are initialized by the cp. once initialized, the parameter 76543210 str reserved table 7-16. spi parameter ram memory map address name width description spi base + 00 rbase word rx bd base address spi base+ 02 tbase word tx bd base address spi base+ 04 rfcr byte rx function code spi base+ 05 tfcr byte tx function code spi base+ 06 mrblr word maximum receive buffer length spi base+ 08 rstate long rx internal state spi base+ 0c long rx internal data pointer spi base+ 10 rbptr word rx bd pointer spi base+ 12 word rx internal byte count spi base+ 14 long rx temp spi base+ 18 tstate long tx internal state spi base+ 1c long tx internal data pointer spi base+ 20 tbptr word tx bd pointer spi base+ 22 word tx internal byte count spi base+ 24 long tx temp
serial peripheral interface (spi) motorola mc68360 user? manual 7-321 ram values will not normally need to be accessed by user software. they should only be modified when no spi activity is in progress. 7.12.5.3.1 bd table pointer (rbase, tbase). the rbase and tbase entries define the starting location in the dual-port ram for the set of bds for receive and transmit func- tions of the spi. this provides a great deal of flexibility in how bds for an spi are partitioned. by setting the w-bit in the last bd in each bd list, the user may select how many bds to allocate for the transmit and receive side of the spi. the user must initialize these entries before enabling the spi. furthermore, the user should not configure bd tables of the spi to overlap any other serial channel? bds, or erratic operation will occur. note rbase and tbase should contain a value that is divisible by 8. 7.12.5.3.2 spi function code registers (rfcr, tfcr). the fc entry contains the value that the user would like to appear on the function code pins (fc3?c0), when the associ- ated sdma channel accesses memory. it also controls the byte-ordering convention to be used in the transfers. receive function code register bits 7??eserved these bits should be set to zero by the user. mot?otorola this bit should be set by the user to achieve normal operation. mot must be set if the data buffer is located in external memory and has a 16-bit wide memory port size. 0 = dec and intel convention is used for byte ordering?wapped operation. it is also called little-endian byte ordering. the bytes stored in each buffer word are reversed as compared to the motorola mode. 1 = motorola byte ordering?ormal operation. it is also called big-endian byte order- ing. as data is received from the serial line and put into the buffer, the most signif- icant byte of the buffer word contains data received earlier than the least significant byte of the same buffer word. fc3?c0?unction code 3? these bits contain the function code value used during this sdma channel? memory ac- cesses. the user should write bit fc3 with a one to identify this sdma channel access as a dma-type access. example: fc3?c0 = 1000. to keep interrupt acknowledge cycles unique in the system, do not write the value 0111 binary to these bits. transmit function code register 76543210 mot fc3?c0 76543210 mot fc 3?c0
serial peripheral interface (spi) 7-322 mc68360 user? manual motorola bits 7??eserved. these bits should be set to zero by the user. mot?otorola this bit should be set by the user to achieve normal operation. mot must be set if the data buffer is located in external memory and has a 16-bit wide memory port size. 0 = dec and intel convention is used for byte ordering?wapped operation. it is also called little-endian byte ordering. the transmission order of bytes within a buffer word is reversed as compared to the motorola mode. 1 = motorola byte ordering?ormal operation. it is also called big-endian byte order- ing. as data is transmitted onto the serial line from the data buffer, the most signif- icant byte of the buffer word contains data to be transmitted earlier than the least significant byte of the same buffer word. fc3?c0?unction code 3? these bits contain the function code value used during this sdma channel? memory ac- cesses. the user should write bit fc3 with a one to identify this sdma channel access as a dma-type access. example: fc3-fc0 = 1000. to keep interrupt acknowledge cycles unique in the system, do not write the value 0111 (binary) to these bits. 7.12.5.3.3 maximum receive buffer length register (mrblr). the spi has one mrblr to define the receive buffer length for that spi. mrblr defines the maximum num- ber of bytes that the quicc will write to a receive buffer on that spi before moving to the next buffer. the quicc may write fewer bytes to the buffer than the mrblr value if a con- dition such as an error or end-of-frame occurs, but it will never write more bytes than the mrblr value. it follows, then, that buffers supplied by the user for use by the quicc should always be of size mrblr (or greater) in length. the transmit buffers for an spi are not affected in any way by the value programmed into mrblr. transmit buffers may be individually chosen to have varying lengths, as needed. the number of bytes to be transmitted is chosen by programming the data length field in the tx bd. notes mrblr is not intended to be changed dynamically while an spi is operating. however, if it is modified in a single bus cycle with one 16-bit move (not two 8-bit bus cycles back-to-back), then a dynamic change in receive buffer length can be successfully achieved. this takes place when the cp moves control to the next rx bd in the table. thus, a change to mrblr will not have an immediate effect. to guarantee the exact rx bd on which the change will occur, the user should change mrblr only while the spi receiver is disabled. the mrblr value should be greater than zero and should be even if the character length of the data is greater than eight bits.
serial peripheral interface (spi) motorola mc68360 user? manual 7-323 7.12.5.3.4 receiver buffer descriptor pointer (rbptr). the rbptr for each spi chan- nel points to the next bd that the receiver will transfer data to when it is in idle state or to the current bd during frame processing. after a reset or when the end of the bd table is reached, the cp initializes this pointer to the value programmed in the rbase entry. although rbptr need never be written by the user in most applications, it may be modified by the user when the receiver is disabled or when the user is sure that no receive buffer is currently in use. 7.12.5.3.5 transmitter buffer descriptor pointer (tbptr). the tbptr for each spi channel points to the next bd that the transmitter will transfer data from when it is in idle state or to the current bd during frame transmission. after a reset or when the end of bd table is reached, the cp initializes this pointer to the value programmed in the tbase entry. although tbptr need never be written by the user in most applications, it may be modified by the user when the transmitter is disabled or when the user is sure that no transmit buffer is currently in use. 7.12.5.3.6 other general parameters. additional parameters are listed in table 7-16. these parameters do not need to be accessed by the user in normal operation, and are listed only because they may provide helpful information for experienced users and for debugging. the rx and tx internal data pointers are updated by the sdma channels to show the next address in the buffer to be accessed. the tx internal byte count is a down-count value that is initialized with the tx bd data length and decremented with every byte read by the sdma channels. the rx internal byte count is a down-count value that is initialized with the mrblr value and decremented with every byte written by the sdma channels. note to extract data from a partially full buffer, the close rx bd command may be used. the rx internal state, tx internal state, rx temp, tx temp, and reserved areas are for risc use only. 7.12.5.4 spi commands. the following transmit and receive commands are issued to the cr. 7.12.5.4.1 init tx parameters command. this command initializes all transmit parameters in this serial channel? parameter ram to their reset state. this command should only be issued when the transmitter is disabled. note that the init tx and rx parameters command may also be used to reset both transmit and receive parameters. 7.12.5.4.2 close rx bd command. the close rx bd command is used to force the spi controller to close the current rx bd, if it is currently being used, and to use the next bd for any subsequent data that is received. if the spi controller is not in the process of receiv- ing data, no action is taken by this command.
serial peripheral interface (spi) 7-324 mc68360 user? manual motorola 7.12.5.4.3 init rx parameters command. this command initializes all the receive parameters in this serial channel? parameter ram to their reset state. this command should only be issued when the receiver is disabled. note that the init tx and rx param- eters command may also be used to reset both receive and transmit parameters. 7.12.5.5 spi buffer descriptor ring. the data associated with the spi is stored in buffers, which are referenced by bds organized in a bd ring located in the dual-port ram (see figure 7-83). this ring has the same basic configuration as those used by the sccs and smcs. the bd ring allows the user to define buffers for transmission and buffers for reception. each bd ring forms a circular queue. the cp confirms reception and transmission or indicates error conditions using the bds to inform the processor that the buffers have been serviced. the actual buffers may reside in either external memory or internal memory. data buffers may reside in the parameter area of an scc if it is not enabled. figure 7-83. spi memory structure 7.12.5.5.1 spi receive buffer descriptor (rx bd). the cp reports information about each buffer of received data using rx bds. the cp closes the current buffer, generates a maskable interrupt, and starts receiving data in the next buffer when the current buffer is full. additionally, it will close the buffer when the spi is configured as a slave and the spisel pin goes to an inactive state, indicating that the reception process is terminated. the first word of the rx bd contains status and control bits. these bits are prepared by the user before reception and are set by the cp after the buffer has been closed. the second word contains the data length, in bytes, that was received. the third and fourth words con- tain a pointer that always points to the beginning of the received data buffer. frame status data length data pointer pointer to spi tx ring dual-port ram external memory tx bd ring tx data buffer pointer to spi rx ring rx bd ring rx data buffer tx data buffer frame status data length data pointer
serial peripheral interface (spi) motorola mc68360 user? manual 7-325 the following bits should be written by the cpu32+ core before enabling the spi. e?mpty 0 = the data buffer associated with this rx bd has been filled with received data, or data reception has been aborted due to an error condition. the cpu32+ core is free to examine or write to any fields of this rx bd. the cp will not use this bd again while the e-bit remains zero. 1 = the data buffer associated with this bd is empty, or reception is currently in progress. this rx bd and its associated receive buffer are owned by the cp. once the e-bit is set, the cpu32+ core should not write any fields of this rx bd. bits 14, 10, 8??eserved w?rap (final bd in table) 0 = this is not the last bd in the rx bd table. 1 = this is the last bd in the rx bd table. after this buffer has been used, the cp will receive incoming data into the first bd in the table (the bd pointed to by rbase). the number of rx bds in this table is programmable and is determined only by the w-bit and the overall space constraints of the dual-port ram. i?nterrupt 0 = no interrupt is generated after this buffer has been filled. 1 = the rxb bit in the spi event register will be set when this buffer has been com- pletely filled by the cp, indicating the need for the cpu32+ core to process the buffer. the rxb bit can cause an interrupt if it is enabled. cm?ontinuous mode this bit is valid only when the spi is configured as a master; it should be written as a zero in slave mode. 0 = normal operation. 1 = the e-bit is not cleared by the cp after this bd is closed, allowing the associated data buffer to be overwritten automatically when the cp next accesses this bd. this allows continuous reception from an spi slave into one buffer for autoscan- ning of a serial a/d peripheral with no cpu overhead. 1514131211109876543210 offset + 0 e w i l cm ovme offset + 2 data length offset + 4 rx data buffer pointer offset + 6
serial peripheral interface (spi) 7-326 mc68360 user? manual motorola the following status bits are written by the spi after the received data has been placed into the associated data buffer. l?ast this bit is set by the spi controller when the buffer is closed due to negation of the spisel pin. this can only occur when the spi is a slave; otherwise, the me bit is set. 0 = this buffer does not contain the last character of the message. 1 = this buffer contains the last character of the message. ov?verrun a receiver overrun occurred during reception. this error can only occur when the spi is a slave. me?ulti-master error this buffer was closed because the spisel pin was asserted when the spi was operating as a master. this indicates a synchronization problem between multiple masters on the spi bus. data length data length is the number of octets that the cp has written into this bd? data buffer. it is written once by the cp as the bd is closed. note the actual amount of memory allocated for this buffer should be greater than or equal to the contents of the mrblr. rx data buffer pointer the receive buffer pointer, which always points to the first location of the associated data buffer, must be even. the buffer may reside in either internal or external memory. 7.12.5.5.2 spi transmit buffer descriptor (tx bd). data to be transmitted with the spi is presented to the cp by arranging it in buffers referenced by the tx bd ring. the first word of the tx bd contains status and control bits. the following bits should be prepared by the user before transmission. 1514131211109876543210 offset + 0 r w i l cm unme offset + 2 data length offset + 4 tx data buffer pointer offset + 6
serial peripheral interface (spi) motorola mc68360 user? manual 7-327 r?eady 0 = the data buffer associated with this bd is not ready for transmission. the user is free to manipulate this bd or its associated data buffer. the cp clears this bit after the buffer has been transmitted or after an error condition is encountered. 1 = the data buffer, which has been prepared for transmission by the user, has not been transmitted or is currently being transmitted. no fields of this bd may be writ- ten by the user once this bit is set. bits 14, 10, 8??eserved w?rap (final bd in table) 0 = this is not the last bd in the tx bd table. 1 = this is the last bd in the tx bd table. after this buffer has been used, the cp will receive incoming data into the first bd in the table (the bd pointed to by tbase). the number of tx bds in this table is programmable, and is determined only by the w-bit and the overall space constraints of the dual-port ram. i?nterrupt 0 = no interrupt is generated after this buffer has been serviced. 1 = the txb or txe bit in the event register is set when this buffer is serviced. txb and txe can cause interrupts if they are enabled. l?ast 0 = this buffer does not contain the last character of the message. 1 = this buffer contains the last character of the message. cm?ontinuous mode this bit is valid only when the spi is configured as a master; it should be written as a zero in slave mode. 0 = normal operation. 1 = the r-bit is not cleared by the cp after this bd is closed, allowing the associated data buffer to be retransmitted automatically when the cp next accesses this bd. the following status bits are written by the spi after it has finished transmitting the associ- ated data buffer. un?nderrun the spi encountered a transmitter underrun condition while transmitting the associated data buffer. this error condition is valid only when the spi is configured as a slave. me?ulti-master error this buffer was closed because the spisel pin was asserted when the spi was operating as a master. this indicates a synchronization problem between multiple masters on the spi bus.
serial peripheral interface (spi) 7-328 mc68360 user? manual motorola data length the data length is the number of octets that the cp should transmit from this bd? data buffer. it is never modified by the cp. this value should normally be greater than zero. if the number of data bits in the character is greater than 8, then the data length should be even. example: to transmit three characters of 8-bit data, 1 start, and 1 stop, the data length field should be initialized to 3. however, to transmit three characters of 9-bit data, the data length field should be initialized to 6 since the three 9-bit data fields occupy three words in memory (the 9 lsbs of each word). tx data buffer pointer the transmit buffer pointer, which always points to the first location of the associated data buffer, may be even or odd (unless the number of actual data bits in the character is great- er than 8 bits, in which case the transmit buffer pointer must be even). the buffer may reside in either internal or external memory. 7.12.5.6 spi event register (spie). the spie is an 8-bit register used to report events recognized by the spi and to generate interrupts. upon recognition of an event, the spi sets its corresponding bit in the spie. interrupts generated by this register may be masked in the spi mask register. the spie is a memory-mapped register that may be read at any time. a bit is cleared by writing a one (writing a zero does not affect a bit? value). more than one bit may be cleared at a time. all unmasked bits must be cleared before the cp will clear the internal interrupt request. this register is cleared at reset. . bits 7, 6, 3?eserved mme?ulti-master error the spi detected that the spisel pin was asserted externally while the spi was in master mode. txe?x error an error occurred during transmission (underrun in spi slave mode). bsy?usy condition received data has been discarded due to a lack of buffers. this bit is set after the first character is received for which there is no receive buffer available. txb?x buffer a buffer has been transmitted. this bit is set once the transmit data of the last character in the buffer was written to the transmit fifo. the user must wait two character times to be sure that the data was completely sent over the transmit pin. 76543210 mme txe bsy txb rxb
serial peripheral interface (spi) motorola mc68360 user? manual 7-329 rxb?x buffer a buffer has been received. this bit is set after the last character has been written to the receive buffer and the rx bd is closed. 7.12.5.7 spi mask register (spim). the spim is an 8-bit read-write register that has the same bit formats as the spi event register. if a bit in the spim is one, the corresponding interrupt in the spie is enabled. if the bit is zero, the corresponding interrupt in the spie will be masked. this register is cleared at reset. 7.12.6 spi master example the following list is an initialization sequence for a high-speed use of the spi as a master. 1. the sdcr (sdma configuration register) should be initialized to $0740, rather than being left at its default value of $0000. 2. write rbase and tbase in the spi parameter ram to point to the rx bd and tx bd in the dual-port ram. assuming one rx bd at the beginning of dual-port ram and one tx bd following that rx bd, write rbase with $0000 and tbase with $0008. note in the case of multi-master operation, the spisel pin should also be enabled to internally connect to the spi. 3. configure a parallel i/o pin to operate as the spi select pin if needed. supposing pb0 is chosen, write pbodr bit 0 with a zero, pbdir bit 0 with a one, and pbpar bit 0 with a zero. write pbdat bit 0 with a zero to constantly assert the select pin. 4. write rbase and tbase in the spi parameter ram to point to the rx bd and tx bd in the dual-port ram. assuming one rx bd at the beginning of dual-port ram and one tx bd following that rx bd, write rbase with $0000 and tbase with $0008. 5. program the cr to execute the init rx & tx params command for this channel. for instance, to execute this command for scc1, write $0001 to the cr. this com- mand causes the rbptr and tbptr parameters of the serial channel to be updated with the new values just programmed into rbase and tbase. 6. write rfcr with $18 and tfcr with $18 for normal operation. 7. write mrblr with the maximum number of bytes per receive buffer. for this case, assume 16 bytes, so mrblr = $0010. 8. initialize the rx bd. assume the rx data buffer is at $00001000 in main memory. write $b000 to rx_bd_status. write $0000 to rx_bd_length (not required done for instructional purposes only). write $00001000 to rx_bd_pointer. 9. initialize the tx bd. assume the tx data buffer is at $00002000 in main memory and contains five 8-bit characters. write $b800 to tx_bd_status. write $0005 to tx_bd_length. write $00002000 to tx_bd_pointer. 10. write $ff to the spie to clear any previous events. 11. write $37 to the spim to enable all possible spi interrupts.
serial peripheral interface (spi) 7-330 mc68360 user? manual motorola 12. write $00000020 to the cimr to allow the spi to generate a system interrupt. (the cicr should also be initialized.) 13. write $0370 to spmode to enable normal operation (not loopback), master mode, spi enabled, 8-bit characters, and the fastest speed possible. 14. write pbdat bit 0 with zero to assert the spi select pin. 15. set the str bit in the spcom to start the transfer. note after 5 bytes have been transmitted, the tx bd is closed. addi- tionally, the receive buffer is closed after 5 bytes have been re- ceived because the l-bit of the tx bd was set. 7.12.7 spi slave example the following list is an initialization sequence for use of the spi as a slave. it is very similar to the spi master example except that the spisel pin is used, rather than a general-pur- pose i/o pin. 1. the sdcr (sdma configuration register) should be initialized to $0740, rather than being left at its default value of $0000. 2. configure the port b pins to enable the spimosi, spimiso, spisel , and spiclk pins. write pbpar bits 0, 1, 2, and 3 with ones. write pbdir bits 0, 1, 2, and 3 with ones. write pbodr bits 0, 1, 2, and 3 with zeros. 3. write rbase and tbase in the spi parameter ram to point to the rx bd and tx bd in the dual-port ram. assuming one rx bd at the beginning of dual-port ram and one tx bd following that rx bd, write rbase with $0000 and tbase with $0008. 4. program the cr to execute the init rx & tx params command for this channel. for instance, to execute this command for scc1, write $0001 to the cr. this com- mand causes the rbptr and tbptr parameters of the serial channel to be updated with the new values just programmed into rbase and tbase. 5. write rfcr with $18 and tfcr with $18 for normal operation. 6. write mrblr with the maximum number of bytes per receive buffer. for this case, assume 16 bytes, so mrblr = $0010. 7. initialize the rx bd. assume the rx data buffer is at $00001000 in main memory. write $b000 to rx_bd_status. write $0000 to rx_bd_length (not required done for instructional purposes only). write $00001000 to rx_bd_pointer. 8. initialize the tx bd. assume the tx data buffer is at $00002000 in main memory and contains five 8-bit characters. write $b800 to tx_bd_status. write $0005 to tx_bd_length. write $00002000 to tx_bd_pointer. 9. write $ff to the spie to clear any previous events. 10. write $37 to the spim to enable all possible spi interrupts. 11. write $00000020 to the cimr to allow the spi to generate a system interrupt. (the
parallel interface port (pip) motorola mc68360 user? manual 7-331 cicr should also be initialized.) 12. write $0170 to spmode to enable normal operation (not loopback), master mode, spi enabled, and 8-bit characters. the spi baud rate generator speed is ignored because the spi is in slave mode. 13. set the str bit in the spcom to enable the spi to be ready once the master begins the transfer. note if the master transmits 3 bytes and negates the spisel pin, the rx bd will be closed, but the tx bd will remain open. if the mas- ter transmits 5 or more bytes, the tx bd will be closed after the 5th byte. if the master transmits 16 bytes and negates the spisel pin, the rx bd will be closed with no errors, and no out- of-buffers error will occur. if the master transmits more than 16 bytes, the rx bd will be closed (completely full), and the out-of- buffers error will occur after the 17th byte is received. 7.12.8 spi interrupt handling the following list describes what would normally occur within an interrupt handler for the spi. 1. once an interrupt occurs, the spie should be read by the user to see which sources have caused interrupts. the spie bits would normally be cleared at this time. 2. process the tx bd to reuse it and the rx bd to extract the data from it. to transmit another buffer, simply set the tx bd r-bit, the rx bd e-bit, and the str bit in spcom. 3. clear the spi bit in the cisr. 4. execute the rte instruction. 7.13 parallel interface port (pip) the pip is a function of the cpm that allows data to be transferred to and from the quicc over 8 or 16 parallel data pins. the pins of the pip are multiplexed with the 18-bit port b par- allel i/o port. the pip supports the centronics interface and a fast parallel connection between quiccs. when the pip is used, the smc2 channel is not available. 7.13.1 pip key features the pip contains the following key features: 18 general-purpose i/o pins three handshake modes programmable handshake timing attributes supports centronics and receiver/transmitter interface allows bidirectional centronics (p1284) operation to be implemented supports fast connection between quiccs can be controlled by the cpu32+ core or by the cpm risc
parallel interface port (pip) 7-332 mc68360 user? manual motorola 7.13.2 pip overview the pip is shown in figure 7-84. the pip may be operated as an 18-bit general-purpose i/ o port or in one of three handshake modes: 8- or 16-bit strobed i/o port with two interlocked handshake signals 8- or 16-bit strobed i/o port with two pulsed handshake signals 8- or 16-bit transparent i/o port with no handshake signals when in one of the handshake modes, the pip is controlled either by the risc controller or the cpu32+ core. when the pip is under risc control, data is prepared by the cpu32+ core (or other host processor) using the same general bd structures as are used for the sccs. thus, the pip can transfer or receive blocks of characters without interrupting the host processor. the data block may span several linked buffers; therefore, an entire block may be received or transmitted without intervention from the cpu32+ core. when the pip is under cpu32+ core control (or the control of an external processor), the pip is controlled directly by the core one byte/word at a time. when the interlocked or pulsed handshake modes are used, the pip offers programmable timing attributes such as setup time, pulse width, etc. the interlocked handshake mode sup- ports level-sensitive handshake control signals. the pulsed handshake mode supports edge-sensitive handshakes like those used for the centronics interface. the pip mode of operation may be configured independently for two groups of port b pins: pb7?b0 and pb17?b8. this configuration allows an 8-bit pip data port to be defined, rather than a full 16-bit data port. figure 7-84. pip block diagram imb pip configuration register peripheral bus pipc ptpr pbdir pbpar pbodr pipe pipm timing parameter register port b data direction port b pin assignments port b open drain register pip event register pip mask register data register handshake control port b pins
parallel interface port (pip) motorola mc68360 user? manual 7-333 the pip shares several registers with the smc2 serial channel. smc2 is not available and should not be enabled if the pip is used. if smc2 is enabled, erratic behavior will occur. 7.13.3 general-purpose i/o pins (port b) in this configuration, the pip is not used, but rather operates as general-purpose parallel i/ o port b. see 7.14.7 port b registers for more details. 7.13.4 interlocked data transfers in the interlocked handshake mode, the pip may be configured as a transmitter or a receiver. this configuration allows a fast connection between quiccs, and may be used for the p1284-protocol advanced byte transfer mode. the interlocked handshake mode may be controlled by the risc or the cpu32+ core. oper- ation using the risc requires bds and parameter ram initialization very similar to the other serial channels. data is then stored in the buffers using one of the sdma channels (one of the available channels from smc2). operation by the cpu32+ core is performed by soft- ware-controlled reads and writes from/to the pip data register upon interrupt request. note at the time of writing, risc operation of the pip has not been fully defined. the user should use the cpu32+ core operation mode, until such time as risc microcode becomes available or the full pip microcode is available in the risc internal rom. please contact the local motorola sales representative to obtain the current status of the pip risc microcode. in the following description, the risc reads and writes of the data register are replaced by cpu32+ core reads and writes. when configured as a transmitter, the stbo pin (pb16) is used as a strobe output (stb ) handshake control signal, and the stbi pin (pb17) is used as an acknowledge (ack ) input. when configured as a receiver, the pip generates the ack signal on the stbo pin and inputs the stb signal on the stbi pin. bits pb16 and pb17 in the port b data direction register (pbdir) and the port b data register (pbdat) corresponding to stbo and stbi are not valid and are ignored by the pip in the interlocked handshake mode. when the pip is in this mode and is configured as a transmitter, the risc controller loads data into the output latch when it receives a request to begin transfers from the host proces- sor (see figure 7-85). once data is loaded, after a programmable setup time, the stb signal is asserted (low). then when ack is sampled as low, the data is transmitted, followed by the stb being negated (high). stb remains high until new data is loaded into the output latch and ack is negated (high). when the pip is configured as a receiver, input data is latched when the stb signal is sam- pled as low. the ack signal is then asserted. ack will be negated (high) when the data has been removed from the input latch.
parallel interface port (pip) 7-334 mc68360 user? manual motorola thus, to connect to quiccs using this interface, connect the stbo pin of each quicc to the stbi pin of the other and connect the desired data pins (either pb8?b15 or pb0?b15 are connected between quiccs). figure 7-85. interlock handshake mode 7.13.5 pulsed data transfers in the pulsed handshake mode, the pip may be configured as a transmitter or a receiver. this configuration allows a centronics-compatible interface to be implemented. the pulsed handshake mode may be controlled by the risc or the cpu32+ core. operation using the risc requires bds and parameter ram initialization very similar to the other serial channels. data is then stored in the buffers using one of the sdma channels (one of the available channels from smc2). operation by the cpu32+ core is performed by software- controlled reads and writes from/to the pip data register upon interrupt request. note at the time of writing, risc operation of the pip has not been fully defined. the user should use the cpu32+ core operation mode until as risc microcode becomes available or the full pip microcode is available in the risc internal rom. please contact the local motorola sales representative to obtain the current sta- tus of the pip risc microcode. in the following description, the risc reads and writes of the data register are replaced by cpu32+ core reads and writes. when configured as a transmitter, the stbo pin (pb16) is used as a strobe output (stb ) handshake control signal, and the stbi pin (pb17) is used as an acknowledge (ack ) input. when configured as a receiver, the pip generates the ack signal on the stbo pin and inputs the stb signal on the stbi pin. bits pb16 and pb17 in the port b data direction register (pbdir) and the port b data register (pbdat) corresponding to stbo and stbi are not valid and are ignored by the pip when the pulsed handshake mode is selected. transmitter data transmitter stb (output ready) receiver ack (input ready) t setup t hold
parallel interface port (pip) motorola mc68360 user? manual 7-335 when configured as a transmitter, the pip generates the stb signal when data is ready in the pip? output latch and the previous transfer has been acknowledged (see figure 7-86). the setup time and the strobe pulse width are user programmable. when configured as a receiver, the pip uses the stb signal to latch the input data and acknowledges the transfer with the ack signal. the timing of the ack signal is user programmable. figure 7-86. pulsed handshake full cycle 7.13.5.1 busy signal. in the pulsed handshake mode, the pip receiver can generate an additional busy handshake signal, which is useful to implement the centronics reception interface (see figure 7-87). the busy signal is an output indication of a transfer in service. it is asserted by the centronics receiver as soon as the data is latched into the pip data reg- ister. the timing of busy negation in relation to the ack signal is user programmable. two bits in the pip configuration register enable the assertion and negation of the busy signal via the host processor software. latch i/o dir = output pin tx data stb ack peripheral bus latch write from risc read from risc write from handshake control logic (dir = out) byte b byte a pip transmit risc/cpu32+ in use risc/cpu32+ in use rx data pip receive byte a byte b
parallel interface port (pip) 7-336 mc68360 user? manual motorola the busy signal is multiplexed onto pb0; therefore, it is not possible to use the busy sig- nal with a full 16-bit pip interface. busy can be used with the standard 8-bit pip interface to implement centronics functions. when in the pulsed handshake mode, the pip transmitter may be configured to ignore the busy signal or to suspend the assertion of the stb output until the receiver? busy signal is negated. figure 7-87. pulsed handshake busy signal 7.13.5.2 pulsed handshake timing. the pulsed handshake mode transmitter timing is shown in figure 7-88. in the pulsed handshake mode, four centronics receive timing options select the relative timing of the busy signal to the ack signal. the timing parameters for the pulsed handshake mode are governed by two user-program- mable timing parameters, tpar1 and tpar2. each parameter defines an interval from 1 to 256 system clocks. figure 7-89 through figure 7-92 show the definition of tpar1 and tpar2 in the four receive modes. figure 7-88. centronics transmitter timing transmitter stbo (stb) transmitter data t setup t width t hold receiver pb0 (busy) receiver stbo (ack) tpar 2 tpar 1 data stb
parallel interface port (pip) motorola mc68360 user? manual 7-337 figure 7-89. centronics receiver timing mode 0 figure 7-90. centronics receiver timing mode 1 figure 7-91. centronics receiver timing mode 2 figure 7-92. centronics receiver timing mode 3 ack tpar2 tpar1 busy (pb0) ack tpar2 tpar1 busy (pb0) ack (pb0) busy tpar2 tpar1 ack busy tpar2 busy cleared by s/w (pb0) stb >tpar1
parallel interface port (pip) 7-338 mc68360 user? manual motorola 7.13.6 transparent data transfers in the transparent handshake mode, the pip may be configured as a transmitter or a receiver. this configuration has only one handshake pin. the transparent mode is controlled only by the risc. operation using the risc requires bds and parameter ram initialization very similar to the other serial channels. data is then stored in the buffers using one of the sdma channels (one of the available channels from smc2). note at the time of writing, this operation of the pip has not been fully defined. this pip operation may be implemented by the cpu32+ core, using the port b parallel i/o registers and any port c interrupt pin. in this mode, the b17 pin falling edge generates the request to the risc, which causes the risc to receive/transmit data. the direction of the pins is controlled by the port b data direc- tion register (pbdir). the transparent handshake mode is shown in figure 7-93. figure 7-93. pip transparent handshake mode 7.13.7 programming model the following paragraphs describe the pip registers and parameter ram. 7.13.7.1 parameter ram. at the time of writing, risc operation on the pip has not been fully defined. the user should use the cpu32+ core operation mode until the risc micro- code becomes available or the full pip microcode becomes available in the risc internal rom. please contact the local motorola sales representative to obtain the current status of the pip risc microcode. latch i/o dir = output write from risc buffer pin read from risc peripheral bus
parallel interface port (pip) motorola mc68360 user? manual 7-339 7.13.7.2 pip configuration register (pipc). the pipc is a 16-bit read-write regis- ter that is cleared at reset. the pipc determines all pip options. str ?tart (valid for a transmitter only) this bit is valid only when the t/r bit is set to 1 (transmitter). setting this bit to 1 causes the risc controller to poll the tx bd. thus, the user should prepare a tx bd and set its r- bit before setting str. str is cleared after one system clock. bits 14?2?eserved sack?et acknowledge when set, this bit will assert the receiver? ack output (low voltage), regardless of the re- ceiver? state. sack should be used when implementing the ieee p1284 bidirectional centronics protocol. cbsy?lear busy this bit is used by host software to force the busy signal low for a centronics receiver. when cbsy is set, the busy signal will output at 0 (low voltage). cbsy is cleared after the pip negates the busy signal. note the t/r bit should be set to 0 (receiver) if cbsy is used. sbsy?et busy this bit is used by host software to force the busy signal high for a centronics receiver. when sbsy is set, the busy signal will output a 1 (high voltage). sbsy is cleared after the pip asserts the busy signal. note the t/r bit should be set to 0 (receiver) if sbsy is used. also, ebsy would normally be set by the user before sbsy is set. (if ebsy is cleared, the pip ignores the stb signal until cbsy is set in software.) ebsy?nable busy (receiver) this bit has a different definition depending on whether t/r is set to receiver or transmit- ter. when t/r = 0 (pip is a receiver), the definition is as follows: 0 = disable busy signal generation on pb0 for the receiver. 1 = enable the busy output signal on pb0. ebsy will only take effect if bit 0 of pbpar is 0 to configure this pin to belong to the pip and bit 0 of pbdir is 1 to make this pin an output. 1514131211109876543210 str sack cbsy sbsy ebsy tmod modl modh hsc t/r
parallel interface port (pip) 7-340 mc68360 user? manual motorola when t/r = 1 (pip is a transmitter), the definition is as follows: 0 = ignore the busy signal input on pb0 for the transmitter. 1 = assertion of stb is conditioned by busy is negation. stb will not be asserted until the busy signal, input on pb0, is negated. ebsy will only take effect if bit 0 of pb- par is 0 to configure this pin to belong to the pip and bit 0 of pbdir is 0 to make this pin an input. note the programming of modl has no effect on the busy pin if ebsy is set. tmod?iming mode (centronics receiver) these bits are only valid when t/r is set to receive and modh is set to pulsed handshake mode. otherwise they are ignored. 00 = centronics receiver timing mode 0 (busy is negated before ack is asserted). 01 = centronics receiver timing mode 1 (busy is negated after ack assertion but be- fore ack negation). 10 = centronics receiver timing mode 2 (busy is negated after ack negation). 11 = centronics receiver timing mode 3 (busy is negated by host software). modl?ode low these bits determine the mode of the pip? lower 8 pins (pb7?b0). 00 = port b general-purpose i/o mode (under host control). 01 = transparent handshake mode (under risc or host control). 1x = mode of operation is controlled by modh. note the busy pin (pb0) is not affected by modl programming if ebsy is set. modh?ode high these bits determine the mode of the pip? upper 10 pins (pb17?b8). modh may be changed when the risc processor is not currently receiving or transmitting data. 00 = port b general-purpose i/o (under host control). 01 = transparent handshake mode (under risc or host control). 10 = interlocked handshake mode (under risc or host control). 11 = pulsed handshake mode (under risc or host control). hsc?ost control 0 = the pip data transfers are controlled by the risc in the cpm, using the pip pa- rameter ram, bds, and sdma channels. 1 = the pip data transfers are controlled by the host software (i.e., cpu32+ or other external processor in the system).
parallel interface port (pip) motorola mc68360 user? manual 7-341 t/r?ransmit/receive select this bit selects transmitter or receiver operation for the pip when it is using the inter- locked, pulsed, or transparent handshake modes. 0 = data is input to the pip. 1 = data is output from the pip. 7.13.7.3 pip timing parameters register (ptpr). the ptpr is a 16-bit read-write register that is cleared at reset. the ptpr holds two timing parameters, tpar1 and tpar2, which are used in the pulsed handshake modes for both a pip transmitter and a receiver. tpar1?iming parameter 1 this 8-bit value defines the number of system clocks for tpar1 in the transmitter or re- ceiver pulsed handshake mode. the value $00 corresponds to 1 quicc general system clock, and the value $ff corresponds to 256 quicc general system clocks. a general system clock defaults to 40 ns, assuming a 25-mhz quicc system. tpar2?iming parameter 2 this 8-bit value defines the number of system clocks for tpar2 in the transmitter or re- ceiver pulsed handshake mode. the value $00 corresponds to 1 quicc general system clock, and the value $ff corresponds to 256 quicc general system clocks. a general system clock defaults to 40 ns, assuming a 25-mhz quicc system. 7.13.7.4 pip buffer descriptors. bds for the receiver and transmitter that support pip operation were still in preparation at the time of writing. 7.13.7.5 pip event register (pipe). the pipe is an 8-bit register used to report events recognized by the pip and to generate interrupts. it shares the same address as the smc2 event register; thus, smc2 cannot be used simultaneously with the pip. upon recognition of an event, the pip sets its corresponding bit in the pipe. interrupts generated by this reg- ister may be masked in the pip mask register. the pipe is a memory-mapped register that may be read at any time. a bit is cleared by writing a one (writing a zero does not affect a bit? value). more than one bit may be cleared at a time. all unmasked bits must be cleared before the cp will clear the internal interrupt request. this register is cleared at reset. bits 7??eserved ccr?ontrol character received a control character was received (with reject (r) = 1) and stored in the receive control character register. 1514131211109876543210 tpar2 tpar1 76543210 ccr bsy chr bd
parallel interface port (pip) 7-342 mc68360 user? manual motorola bsy?usy condition a data byte/word was not received/transmitted by the pip due to lack of buffers. chr?haracter received/transmitted a data character was transmitted or received. this event may be used to generate inter- rupts to the cpu32+ core if the pip was programmed to be controlled by host software. bd?x/tx buffer a complete buffer has been received/transmitted on the pip channel. the channel closes the receive buffer due to one of the following events: reception of a user-defined control character (and reject (r) = 0 for that character in the centronics control characters table). data length termination (the receive buffer was filled, or the transmit buffer has finished transmitting). reception of a programmable silence period. 7.13.7.6 pip mask register (pipm). the pipm is an 8-bit read-write register. it shares the same address as the smc2 mask register; thus, smc2 cannot be used simultaneously with the pip. each bit in the pipm corresponds a bit in the pipe. if a bit in the pipm is a one, the corresponding interrupt in the pipe will be enabled. if the bit is a zero, the corresponding interrupt in the pipe will be masked. this register is cleared at reset. 7.13.8 centronics controller overview centronics is a parallel peripheral interface bus that is generally used as a communication channel between a host computer and printing equipment. the interface uses an 8 bit data bus, handshake signals that control the data exchange, and some status lines that reflect the peripheral device status. traditionally, the direction of data transfer is from the host com- puter to the peripheral device. new standards, such as ieee p1284, allow reverse channel operation (i.e data can be transferred from the peripheral to the host.)
parallel interface port (pip) motorola mc68360 user? manual 7-343 the centronics controller can be operated as a host port (transmitter), peripheral port (receiver), or can support bidirectional data transfer using some s/w support and a combi- nation of the two modes. data strobe* busy ack* select perror fault* a c b d e fh i j figure 7-94. centronics interface signals
parallel interface port (pip) 7-344 mc68360 user? manual motorola 7.13.8.1 centronics controller key features. super-set of the centronics standard 8-bit or 16-bit data transfer pb[15:8] data[7:0] stb* ack* select perror fault* busy pb16 pb17 pb0 pb1 pb2 pb3 centronics device quicc (host) pb[15:8] data[7:0] stb* ack* select perror fault* busy pb17 pb16 pb0 pb1 pb2 pb3 host quicc (centronics device) figure 7-95. centronics receiver [*] [*] [*] [*] [*] [*] [*] [*] [*] - optional figure 7-95. centronics transmitter configuration
parallel interface port (pip) motorola mc68360 user? manual 7-345 supports closed loop handshake for higher data transfer rates supports centronics transmitter and receiver operating modes supports bidirectional centronics (p1284) flexible message-oriented data structure flexible control character comparison (receiver) flexible timing modes programmable timing parameters 7.13.8.2 centronics channel transmission. the centronics transmitter supports the same general data structure that is used by the sccs for other protocols. when the str bit in the pip configuration register is set, the centronics controller will process the next buffer descriptor (bd) in the centronics transmitter bd table. if the bd is ready, the centron- ics transmitter will fetch the data from the memory and start sending it to the printer. if the status mask bits are set in the smask register, the printer status line (select, perror and fault ) will be checked before each transfer. in this case, the user should configure pb1,2,3 pins as general purpose inputs and connect them to select, perror, and fault respectively. for each transfer the centronics controller will output the data on the centronics interface data lines and will generate the strobe pulse if previous data was acknowledged and the minimum setup time was met. the strobe pulse width and the setup time parameters are programmed by the pip timing parameter register (ptpr). a single data frame may span several bds. a maskable interrupt can be generated after the processing of each bd. 7.13.8.3 centronics transmitter memory map. when configured to operate in centronics transmit mode, the quicc overlays the structure illustrated in table 7-17 with the smc2 parameter ram area. table 7-17. centronics transmitter parameter ram address name width description pip base+00 res word reserved pip base+02 tbase word tx buffer descriptors base address pip base+04 cfcr byte centronics function code pip base+05 smask byte status mask pip base+06 res word reserved pip base+08 res long reserved pip base+0c res long reserved pip base+10 res word reserved pip base+12 res word reserved pip base+14 res long reserved pip base+18 tstate long tx internal state pip base+1c t_ptr long tx internal data pointer pip base+20 tbptr word tx buffer descriptor pointer pip base+22 t_cnt word tx internal byte count pip base+24 ttemp long tx temp
parallel interface port (pip) 7-346 mc68360 user? manual motorola certain parameter ram values above (marked in bold face ) need to be initialized by the user before the pip is enabled; the others are initialized/written by the cp. once initialized, most parameter ram values will not need to be accessed in user software since most of the activity is centered around the transmit buffer descriptors, not the parameter ram. 7.13.8.4 buffer descriptor table pointer (tbase). the tbase entry defines the starting location in the dual-port ram for the pip transmitter? set of buffer descriptors. this provides a great deal of flexibility in how bds are partitioned. by programming the tbase entry and by setting the "wrap" bit in the last bd , the user may select how many bds to allocate for the transmit function. the user must initialize tbase before enabling the channel. note tbase should contain a value that is divisible by 8. 7.13.8.5 status mask register (smask). the status mask register controls which of the printer status lines will be checked before each transfer.. s?elect error 0 = the select status will be ignored 1 = the select status line will be checked during transmission pe?rinter error 0 = the perror status will be ignored 1 = the perror status line will be checked during transmission f?ault 0 = the fault status will be ignored 1 = the fault status line will be checked during transmission 7.13.8.6 centronics function code register (cfcr). the fc entry contains the value that the user would like to appear on the function code pins (fc3-0) when the associ- ated sdma channel accesses memory. it also controls the byte ordering convention to be used in the transfers. fc3-0?unction code 3-0 these bits contain the function code value used during this sdma channel? memory ac- cesses. it is suggested that the user write bit fc3 with a one to identify this sdma channel 76543210 0000fpes0 76543210 res res res mot
parallel interface port (pip) motorola mc68360 user? manual 7-347 access as a dma-type access. example: fc3-fc0 = 1000 (binary). do not write the value 0111 (binary) to these bits. mot?otorola this bit should be set by the user to achieve normal operation. 0 = dec (and intel) convention is used for byte ordering. swapped operation. also called little-endian byte ordering. the bytes stored in each buffer word are reversed as compared to the motorola mode. 1 = motorola byte ordering. normal operation. also called big-endian byte ordering. as data is received from the serial line and put into the buffer, the most significant byte of the buffer word contains data received earlier than the least significant byte of the same buffer word. res?eserved. should be set to zero by the user. 7.13.8.7 transmitter buffer descriptor pointer (tbptr). the transmitter buffer descriptor pointer (tbptr) points to the next bd that the transmitter will transfer data from when it is in idle state, or to the current bd during frame transmission. after a reset or when the end of bd table is reached, the cp initializes this pointer to the value pro- grammed in the tbase entry. although tbptr need never be written by the user in most applications, it may be modified by the user when the transmitter is disabled, or when the user is sure that no transmit buffer is currently in use (i.e. after the stop transmit com- mand is issued.) 7.13.8.8 centronics transmitter programming model. the host configures the pip to operate as a centronics controller by programming the pip configuration register (pipc). timing attributes (minimum data setup time and strobe pulse width) are set by pro- gramming the pip timing parameters register (ptpr). the transmit errors are reported through the tx bd. 7.13.8.9 centronics transmitter command set. the centronics transmitter uses smc2 transmit commands (i.e, same opcodes and channel number) 7.13.8.9.1 stop transmit command. the channel stop transmit command dis- ables the transmission of frames on the transmit channel. if this command is received by the centronics controller during frame transmission, transmission of that buffer is aborted and the tbptr is not advanced to the next bd. no new bd is accessed, and no new buffers are transmitted for this channel. the transmitter will idle until the restart transmit com- mand is given. 7.13.8.9.2 restart transmit command. the restart transmit command is used to begin or resume transmission from the current tx bd pointer (tbptr) in the chan- nel? tx bd table. when this command is received by the channel following by the str bit in the pip configuration register (pipc) being set, it will start processing the current bd. this command is expected by the centronics controller after a stop transmit command, after the disabling of the channel in its mode register, or after a transmitter error occurs.
parallel interface port (pip) 7-348 mc68360 user? manual motorola 7.13.8.9.3 init tx parameters command. initializes all the transmit parameters in this centronics channel? parameter ram to their reset state. this command should only be issued when the transmitter is disabled. 7.13.8.10 transmission errors. 7.13.8.10.1 buffer descriptor not ready. this error occurs if the centronics transmitter is active (str bit in the pip mode register was asserted by the host) and the current bd that should be processed by the centronics controller is not ready (r bit in the bd = 0). when this condition occurs, the txe (transmit error) interrupt will be set. the channel will resume transmission after the s/w prepares the bd and asserts the str bit. 7.13.8.10.2 printer off-line error . this error occurs if the printer is off-line (select line is negated) and if the printer status check option is enabled. the s bit will be set in the bd and tx error (txe) interrupt will be set. the channel will resume transmission after restart transmit command. 7.13.8.10.3 printer fault. this error occurs if the printer has a fault condition (fault* line asserted) and if the printer status check option is enabled. the f bit will be set in the bd and tx error (txe) interrupt will be set. the channel will resume transmission after restart transmit command. 7.13.8.10.4 paper error. this error occurs if the printer has an error in its paper path (per- ror line asserted) and if the printer status check option is enabled. the pe bit will be set in the bd and tx error (txe) interrupt will be set. the channel will resume transmission after restart transmit command 7.13.8.10.5 centronics transmitter buffer descriptor. the cp confirms transmission (or indicates error conditions) via the buffer descriptors to inform the processor that the buffers have been serviced. r?eady 0 = the data buffer associated with this bd is not currently ready for transmission. the user is free to manipulate this bd or its associated data buffer. the cp clears this bit after the buffer has been transmitted or after an error condition is encountered. 1 = the data buffer, which has been prepared for transmission by the user, has not been transmitted or is currently being transmitted. no fields of this bd may be writ- ten by the user once this bit is set. 1514131211109876543210 offset + 0 r wi l cm fpes offset + 2 data length offset + 4 tx data buffer pointer offset + 6
parallel interface port (pip) motorola mc68360 user? manual 7-349 w?rap (final bd in table) 0 = this is not the last buffer descriptor in the tx bd table. 1 = this is the last buffer descriptor in the tx bd table. after this buffer has been used, the cp will receive incoming data into the first bd in the table (the bd pointed to by tbase). the number of tx bds in this table is programmable, and is deter- mined only by the wrap bit and the overall space constraints of the dual-port ram. i?nterrupt 0 = no interrupt is generated after this buffer has been serviced. 1 = the tx bit in the pip event register will be set when this buffer has been serviced by the cp, which can cause an interrupt. l?ast 0 = this buffer is not the last buffer of the frame. 1 = this buffer is the last buffer of the frame. cm?ontinuous mode 0 = normal operation. 1 = the r-bit is not cleared by the cp after this buffer is closed, allowing the associated data buffer to be retransmitted automatically when the cp next accesses this bd. however, the r bit will be cleared if an error occurs during transmission f?ault 0 = the fault status remained negated during transmission 1 = the fault status was asserted during transmission pe?rinter error 0 = the perror status remained negated during transmission 1 = the perror status was asserted during transmission s?elect error 0 = the select status remained asserted during transmission 1 = the select status was negated during transmission 7.13.8.11 centronics transmitter event register (pipe) . when the centron- ics transmitter protocol is selected, the smc2 event register is called the centronics trans- mitter event register. it is an 8-bit register which is used to report events recognized by the centronics channel and generate interrupts. on recognition of an event, the centronics con- troller will set its corresponding bit in the centronics event register. the centronics event register is a memory-mapped register that may be read at any time. a bit is cleared by writing a one (writing a zero does not affect a bit? value). more than one bit may be cleared at a time. all unmasked bits must be cleared before the cp will clear the internal interrupt request. this register is cleared at reset.
parallel interface port (pip) 7-350 mc68360 user? manual motorola txe?ransmit error an error condition was detected. this error status is reported in the buffer descriptor. chr?haracter transmitted acknowledgment that the last character was strobed into the receiver input latch (stb was asserted by the transmitter) and a new character was written to the data register. tx?x buffer a buffer has been transmitted over the centronics channel. this bit is set only after the last character of the buffer was strobed into the receiver input latch (stb was asserted by the transmitter). 7.13.8.12 centronics channel reception. the centronics receiver supports the same general data structure that is used by the sccs for other protocols. upon receiving a character from the centronics interface, the receiver will check if the current buffer descrip- tor (bd) in the centronics receiver bd table is ready for use. if the bd is ready, the centron- ics receiver will compare the character against a user defined control character table. if no match was found, the character will be written to the bd? associated buffer. if a match was found, the character will be either written to the receive buffer (upon which the buffer is closed and a new receive buffer taken) or rejected, depending on the r bit in the control character table. if rejected, the character is written to the received control character reg- ister (rccr) in internal ram and a maskable interrupt is generated. a maskable interrupt will be generated at the completion of the bd processing. a single received data frame may span several bds. for each transfer, the centronics controller will generate ack and busy handshake signals on the centronics interface. the ack pulse width and the timing of busy with respect to the ack signal are determined by the setting in the pip timing parameter register (ptpr). 7.13.8.13 centronics receiver memory map. when configured to operate in cen- tronics receive mode, the quicc overlays the structure illustrated in table 7-17 with the smc2 parameter ram area. 76543210 txe chr tx table 7-18. centronics receiver parameter ram address name width description pip base+00 rbase word rx buffer descriptors base address pip base+02 res word reserved pip base+04 cfcr byte centronics function code pip base+05 res byte reserved pip base+06 mrblr word maximum receive buffer length pip base+08 rstate long rx internal state pip base+0c r_ptr long rx internal data pointer pip base+10 rbptr word rx buffer descriptor pointer
parallel interface port (pip) motorola mc68360 user? manual 7-351 certain parameter ram values above (marked in bold face ) need to be initialized by the user before the pip is enabled; the others are initialized/written by the cp. once initialized, most parameter ram values will not need to be accessed in user software since most of the activity is centered around the transmit buffer descriptors, not the parameter ram. 7.13.8.14 buffer descriptor table pointer (rbase). the rbase entry defines the starting location in the dual-port ram for the pip receiver? set of buffer descriptors. this provides a great deal of flexibility in how bds are partitioned. by programming the rbase entry and by setting the "wrap" bit in the last bd, the user may select how many bds to allo- cate for the receive function. the user must initialize rbase before enabling the channel. note .rbase should contain a value that is divisible by 8. 7.13.8.15 centronics function code register (cfcr). the fc entry contains the value that the user would like to appear on the function code pins (fc3-0) when the associated sdma channel accesses memory. it also controls the byte ordering convention to be used in the transfers. pip base+12 r_cnt word rx internal byte count pip base+14 rtemp long rx temp pip base+18 res word reserved pip base+1c res word reserved pip base+20 res word reserved pip base+22 res word reserved pip base+24 res long reserved pip base+28 max_sl word maximum silence period pip base+2a sl_cnt word silence counter pip base+2c charcter1 word control character 1 pip base+2e charcter2 word control character 2 pip base+30 charcter3 word control character 3 pip base+32 charcter4 word control character 4 pip base+34 charcter5 word control character 5 pip base+36 charcter6 word control character 6 pip base+38 charcter7 word control character 7 pip base+3a charcter8 word control character 8 pip base+3c rccm word receive control character mask pip base+3e rccr word receive character control register table 7-18. centronics receiver parameter ram address name width description
parallel interface port (pip) 7-352 mc68360 user? manual motorola fc3-0 ?unction code 3-0 these bits contain the function code value used during this sdma channel? memory ac- cesses. it is suggested that the user write bit fc3 with a one to identify this sdma channel access as a dma-type access. example: fc3-fc0 = 1000 (binary). do not write the value 0111 (binary) to these bits. mot?otorola this bit should be set by the user to achieve normal operation. 0 = dec (and intel) convention is used for byte ordering. swapped operation. also called little-endian byte ordering. the bytes stored in each buffer word are reversed as compared to the motorola mode. 1 = motorola byte ordering. normal operation. also called big-endian byte ordering. as data is received from the serial line and put into the buffer, the most significant byte of the buffer word contains data received earlier than the least significant byte of the same buffer word. res?eserved. should be set to zero by the user. 7.13.8.16 receiver buffer descriptor pointer (rbptr). the receiver buffer descriptor pointer (rbptr) points to the next bd that the receiver will transfer data to when it is in idle state, or to the current bd during frame reception. after a reset or when the end of bd table is reached, the cp initializes this pointer to the value programmed in the rbase entry. although rbptr need never be written by the user in most applications, it may be modified by the user when the receiver is disabled. 7.13.8.17 centronics receiver programming model. the host configures the pip to operate as a centronics controller by programming the pip configuration register (pipc). timing attributes (ack pulse width and the timing between ack and busy) are set by programming the pip timing parameters register (ptpr). the receive errors are reported through the rx bd. 7.13.8.18 centronics control characters. the centronics receiver has the capability to recognize special control characters. these characters may be used when the centronics functions in a message oriented environment. up to eight control characters may be defined by the user in the control characters table. each of these characters may be either written to the receive buffer (upon which the buffer is closed and a new receive buffer taken) or rejected. if rejected, the character is written to the received control character register (rccr) in internal ram and a maskable interrupt is generated. this method is useful for notifying the user of the arrival of control characters that are not part of the received messages. the centronics receiver uses a table of 16-bit entries to support control character recogni- tion. each entry consists of the control character, a valid bit, and a reject character bit. 76543210 res res res mot fc3?c0
parallel interface port (pip) motorola mc68360 user? manual 7-353 character1-8?ontrol character values these fields define control characters that should be compared to the incoming character. for less than 8 bits characters, the msb bits should be zero. e?nd of table 0 = this entry is valid. the lower 8 bits will be checked against the incoming character. 1 = the entry is not valid. this must be the last entry in the control characters table. note in tables with 8 control characters this bit is always 0. r?eject character 0 = the character is not rejected but written into the receive buffer. the buffer is then closed and a new receive buffer is used if there is more data in the message. a maskable (i bit in the receive bd) interrupt is generated. 1 = if this character is recognized it will not be written to the receive buffer. instead, it is written to the received control characters register (rccr) and a maskable in- terrupt is generated. the current buffer is not closed when a control character is received with r set. rccm?eceived control character mask the value in this register is used to mask the comparison of character1 through character8. the lower eight bits of rccm correspond to the lower eight bits of character1-8, and are decoded as follows. 0 = mask this bit in the comparison of the incoming character, and character1 through character8. 1 = the address comparison on this bit proceeds normally. no masking takes place. note the two most significant bits (bit 15 and bit 14) of rccm must be set, or erratic operation may occur during the control charac- ter recognition process. 1514131211109876543210 offset + 0 e r character1 offset + 2 e r character2 offset + 4 e r character3 offset + 6 offset + e e r character8 offset + 10 1 1 rccm offset +1 2 rccr
parallel interface port (pip) 7-354 mc68360 user? manual motorola rccr?eceived control character register upon a control character match for which the reject bit is set, the centronics will write the control character into the rccr and generate a maskable interrupt. the core must pro- cess the interrupt and read the rccr before a second control character arrives. failure to do so will result in the centronics overwriting the first control character. 7.13.8.19 centronics silence period. the centronics controller may be pro- grammed to close the receive data buffer after a programmable silence period. the length of the silence period is determined by the max_sl register value. the centronics controller will decrement the max_sl value every 1024 system clocks. if it reaches zero before any data received, the receive buffer will be closed automatically. setting max_sl value to zero disables this function. 7.13.8.20 centronics receiver command set. 7.13.8.20.1 init rx parameters command. initializes all the receive parameters in the centronics parameter ram to their reset state. this command should only be issued when the receiver is disabled. 7.13.8.20.2 close rx bd command. the close rx bd command is used to force the centronics controller to close the current receive bd if it is currently being used and to use the next bd in the list for any subsequent data that is received. if the centronics controller is not in the process of receiving data, no action is taken by this command. 7.13.8.21 receiver errors. 7.13.8.21.1 buffer descriptor busy. this error occurs if a character was received from the centronics interface and the current bd that should be processed by the centronics control- ler is not empty (e bit in the bd = 0). the channel will resume reception after the s/w pre- pares the bd. 7.13.8.22 centronics receive buffer descriptor. the cp confirms transmis- sion (or indicates error conditions) via the buffer descriptors to inform the processor that the buffers have been serviced. e?mpty 0 = the data buffer associated with this bd has been filled with received data, or data reception has been aborted due to an error condition. the core is free to examine or write to any fields of this rx bd. the cp will not use this bd again while the emp- ty bit remains zero. 1 = the data buffer associated with this bd is empty, or reception is currently in progress. this rx bd and its associated receive buffer are owned by the cp. once the e bit is set, the cpu32+ core should not write any fields of this rx bd. 1514131211109876543210 offset + 0 e wi c cm sl offset + 2 data length offset + 4 tx data buffer pointer offset + 6
parallel interface port (pip) motorola mc68360 user? manual 7-355 w?rap (final bd in table) 0 = this is not the last buffer descriptor in the rx bd table. 1 = this is the last buffer descriptor in the rx bd table. after this buffer has been used, the cp will receive incoming data into the first bd in the table (the bd pointed to by rbase). the number of rx bds in this table is programmable, and is deter- mined only by the wrap bit and the overall space constraints of the dual-port ram. i?nterrupt 0 = no interrupt is generated after this buffer has been filled. 1 = the rx bit in the centronics event register will be set when this buffer has been completely filled by the cp, indicating the need for the cpu32+ core to process the buffer. the rx bit can cause an interrupt if it is enabled. c?ontrol character 0 = this buffer does not contain a control character. 1 = this buffer contains a control character. the last byte in the buffer is one of the user defined control characters. cm?ontinuous mode 0 = normal operation. 1 = the e-bit is not cleared by the cp after this buffer is closed, allowing the associated data buffer to be overwritten automatically when the cp next accesses this bd. sl?ilence the buffer was closed due to the expiration of the programmable silence period timer (de- fined in max_sl). 7.13.8.23 centronics receiver event register (pipe). when the centronics receiver protocol is selected, the smc2 event register is called the centronics receiver event register. it is an 8-bit register which is used to report events recognized by the cen- tronics channel and generate interrupts. on recognition of an event, the centronics control- ler will set its corresponding bit in the centronics event register. the centronics event register is a memory-mapped register that may be read at any time. a bit is cleared by writing a one (writing a zero does not affect a bit? value). more than one bit may be cleared at a time. all unmasked bits must be cleared before the cp will clear the internal interrupt request. this register is cleared at reset. ccr?ontrol character received a control character was received (with reject (r) character = 1) and stored in the receive control character register (rccr). bsy?usy condition a character was received and discarded due to lack of buffers. reception continues as soon as an empty buffer is provided. 76543210 ccrbsychrrx
parallel i/o ports 7-356 mc68360 user? manual motorola chr?haracter received a character was received from the centronics channel and was written to the receive buff- er. rx?x buffer a buffer has been received on the centronics channel. 7.13.9 port b registers the pip is associated with parallel i/o port b. the basic operation of the port is shown in figure 7-96. the registers are described in the port b description; however, the registers as they relate to the pip are mentioned in the following paragraphs. 7.13.9.1 port b assignment registers (pbpar). the pbpar is an 18-bit, mem- ory-mapped, read-write register. to use port b pins as pip pins, the corresponding pbpar bits must be cleared, and the modh and modl bits in the pip configuration register may be configured as desired. figure 7-96. port b general-purpose i/o 7.13.9.2 data direction register (pbdir). the pbdir is an 18-bit, memory- mapped, read-write register. the description of pbdir in 7.14.7 port b registers is also valid for the pip. 7.13.9.3 data register (pbdat). pbdat functions as the pip data register when the pip is operational. this register is used to receive/transmit pip data when the pip is under host software control. the description of pbdat in 7.14.7 port b registers is also valid for the pip. 7.13.9.4 open-drain register (pbodr). the description of pbodr in 7.14.7 port b registers is also valid for the pip. 7.14 parallel i/o ports the cpm supports three general-purpose i/o ports: a, b, and c. latch i/o dir = output write from imb buffer pin read from imb imb
parallel i/o ports motorola mc68360 user? manual 7-357 7.14.1 parallel i/o key features the parallel i/o ports contain the following key features: port a is 16 bits port b is 18 bits port c is 12 bits all ports are bidirectional all ports have alternate on-chip peripheral functions all ports are three-stated at system reset all pin values may be read while pin is connected to an on-chip peripheral port a and port b offer open-drain capability port c offers 12 interrupt input pins 7.14.2 parallel i/o overview each pin in the i/o ports may be configured as a general-purpose i/o pin or as a dedicated peripheral interface pin. port a is shared with the scc rxd and txd pins, the bank of clocks pins, and some tdm pins. port b is shared with the pip and other functions such as the idma, smc, and spi pins. port c is shared with the rts , cts , and cd pins of the sccs as well as some tdm pins. port c is unique in that its pins may generate interrupts to the cpm interrupt controller. each pin may be configured as an input or output and has a latch for data output. each pin may be read or written at any time. each pin may be configured as general-purpose i/o or as a dedicated peripheral pin. port a and port b have pins that can be configured as open-drain?hat is, the pin may be configured in a wired-or configuration on the board. the pin drives a zero voltage, but three-states when driving a high voltage. notes the port pins do not have internal pullup resistors. due to the significant flexibility of the quicc? cpm, many ded- icated peripheral functions are multiplexed onto ports a, b, and c. the functions are grouped in such a way as to maximize the usefulness of the pins in the greatest number of quicc applica- tions. the reader may not obtain a full understanding of the pin assignment capability described in this section until attaining an understanding of the cpm peripherals themselves. 7.14.3 port a pin functions refer to table 7-19 for the default description of all port a pin options. the pins marked in boldface can have open-drain capability. each of the 16 port a pins is independently con- figured as a general-purpose i/o pin if the corresponding port a pin assignment register
parallel i/o ports 7-358 mc68360 user? manual motorola (papar) bit is cleared. each pin is configured as a dedicated on-chip peripheral pin if the corresponding papar bit is set. when the port a pin is configured as a general-purpose i/o pin, the signal direction for that pin is determined by the corresponding control bit in the port a data direction register (padir). the port a i/o pin is configured as an input if the corresponding padir bit is cleared; it is configured as an output if the corresponding padir bit is set. all papar bits and padir bits are cleared on total system reset, configuring all port a pins as general-pur- pose input pins. notes: 1: only available on rev c mask or later. not available on rev a or b. and when pa6 or pa7 is not used as txd4 or rxd4 functions rev a mask is c63t rev b mask are c69t, and f35g current rev c mask are e63c, e68c and f15w if a port a pin is selected as a general-purpose i/o pin, it may be accessed through the port a data register (padat). data written to the padat is stored in an output latch. if a port a pin is configured as an output, the output latch data is gated onto the port pin. in this case, when padat is read, the port pin itself is read. if a port a pin is configured as an input, data written to padat is still stored in the output latch but is prevented from reaching the port pin. in this case, when padat is read, the state of the port pin is read. if an input to a peripheral is not supplied from a pin, then a default value is supplied to the on-chip peripheral as listed in table 7-19. table 7-19. port a pin assignment pin function papar = 1 input to on-chip signal papar = 0 padir = 0 padir = 1 peripherals pa0 port a0 rxd1 rxd4 1 gnd pa1 port a1 txd1 txd4 1 pa2 port a2 rxd2 gnd pa3 port a3 txd2 pa4 port a4 rxd3 l1txdb undefined pa5 port a5 txd3 l1rxdb gnd pa6 port a6 rxd4 l1txda undefined pa7 port a7 txd4 l1rxda l1rxda = gnd pa8 port a8 clk1/tin1/l1rclka brgo1 clk1/tin1/l1rclka = brgo1 pa9 port a9 clk2 tout1 clk2 = gnd pa10 port a10 clk3/tin2/l1tclka brgo2 clk3/tin2/l1tclka = brgo2 pa11 port a11 clk4 tout2 clk4 = clk8 pa12 port a12 clk5/tin3 brgo3 clk5/tin3 = brgo3 pa13 port a13 clk6/l1rclkb tout3 clk6/l1rclkb = gnd pa14 port a14 clk7/tin4 brgo4 clk7/tin4 = brgo4 pa15 port a15 clk8/l1tclkb tout4 clk8/l1tclkb = gnd
parallel i/o ports motorola mc68360 user? manual 7-359 7.14.4 port a registers port a has four memory-mapped, read-write, 16-bit control registers. 7.14.4.1 port a open-drain register (paodr). the paodr indicates a normal or wired-or configuration of the port pins. six of the paodr bits can be open-drain to corre- spond to those pins that have serial channel output capability. the other bits are always zero. paodr is cleared at system reset. for each odx bit, the definition is as follows: 0 = the i/o pin is actively driven as an output. 1 = the i/o pin is an open-drain driver. as an output, the pin is actively driven low, but in three-stated otherwise. 7.14.4.2 port a data register (padat). a read of padat returns the data at the pin, independent of whether the pin is defined as an input or an output. this allows detection of output conflicts at the pin by comparing the written data with the data on the pin. a write to the padir is latched, and if that bit in the padir is configured as an output, the value latched for that bit will be driven onto its respective pin. padat can be read or written at any time. padat is not initialized and is undefined at reset. 7.14.4.3 port a data direction register (padir). padir is cleared at system reset. for each drx bit, the definition is as follows: 0 = the corresponding pin is an input. 1 = the corresponding pin is an output. 7.14.4.4 port a pin assignment register (papar). papar is cleared at system reset. 1514131211109876543210 00000000od7od6od5od4od30od10 1514131211109876543210 d15 d14 d13 d12 d11 d10 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 1514131211109876543210 dr15 dr14 dr13 dr12 dr11 dr10 dr9 dr8 dr7 dr6 dr5 dr4 dr3 dr2 dr1 dr0 1514131211109876543210 dd15 dd14 dd13 dd12 dd11 dd10 dd9 dd8 dd7 dd6 dd5 dd4 dd3 dd2 dd1 dd0
parallel i/o ports 7-360 mc68360 user? manual motorola for each ddx bit, the definition is as follows: 0 = general-purpose i/o. the peripheral functions of the pin are not used. 1 = dedicated peripheral function. the pin is used by the internal module. the on-chip peripheral function to which it is dedicated may be determined by other bits such as those is the padir. 7.14.5 port a examples the following paragraphs discuss various ways some of the port a pins can be configured. figure 7-97 and figure 7-98 show block diagrams of the pa0 and pa1 pins. pa0 can be configured as a general-purpose i/o pin, but not an open-drain pin. it may also be the rxd1 pin for scc1 in the nmsi mode. if pa0 is configured as a general-purpose i/ o pin, then the rxd1 input is internally grounded. if scc1 is connected to a tdm or is not used, then pa0 may be used as general-purpose i/o. pa1 can be configured as a general-purpose i/o pin, either open-drain or not. it may also be the txd1 pin for scc1 in the nmsi mode. if txd1 is configured as an output on pa1 and the od1 bit is set in paodr, then txd1 will be output from scc1 as an open-drain output. if pa1 is configured as a general-purpose i/o pin, then the txd1 output is not con- nected externally. if scc1 is connected to a tdm or is not used, then pa1 may be used as a general-purpose i/o. figure 7-97. parallel block diagram for pa0 mux mux 0 1 en en 0 1 rxd1/pa0 pin mux en 1 0 rxd1 to scc1 16 bits to padat bit 0 output latch padir 16 bits papar en en cpm priority resolver request to the imb at programmable level (1?) port c11?ort c0 timer1 timer2 timer3 timer4 scc1 scc2 scc3 scc4 smc1 smc2 spi pip idma1 idma2 sdma bus error risc timer table 12 32-bit cpm interrupt pending register (cpir) cpm vector generation logic interrupt arbitration id is fixed at level 8. 8-bit interrupt vector (lower 5 bits fixed, upper 3 bits programmable). 8 intermodule bus (imb) sources
parallel i/o ports motorola mc68360 user? manual 7-361 figure 7-98. parallel block diagram for pa1 pa4 can be configured as a general-purpose i/o pin, and as an open-drain pin. it may also be the rxd3 pin for scc3 in the nmsi mode if the padir bit is a zero. it may also be the l1txdb pin for tdmb if the padir bit is a one. if pa4 is configured as a general-purpose i/o pin, then the rxd3 input is not defined. if scc3 is connected to a tdm or is not used, then pa4 may be used as general-purpose i/o. pa8 can be configured as a general-purpose i/o pin, but not an open-drain pin. if the corre- sponding padir bit is a zero, it may also be the clk1 pin (part of the bank of clocks in the si), the tin1 pin (input to timer 1), or the l1rclka pin (receive clock to tdma) or all three at once. there is no selection between these three inputs in port a, because the connections are made separately in the si and the timer mode registers. if the padir bit is a one, this pin may also be the brgo1 pin (output from brg1). if the pa8 pin is a general-purpose i/ o pin, then the input to the on-chip peripheral (clk1, tin1, or l1rclka) is internally con- nected to brgo1. see 7.8 serial interface with time slot assigner for more details on the use of the clk1 and l1rclka pins. pa11 can be configured as a general-purpose i/o pin, but not an open-drain pin. if the padir bit is a zero, pa11 may also be the clk4 pin (part of the bank of clocks). if the padir bit is a one, pa11 may also be the tout2 pin (output from timer 2). if the pa11 pin is a general-purpose i/o pin, then the input to the on-chip clk4 function is the value supplied on the clk8 pin. this interesting option is useful because not all clk pins can be routed to all serial channels in all situations. the ability to send a clock from clk8 to clk4 can increase the flexibility of this assignment process. see 7.8 serial interface with time slot assigner for more details. mux mux 0 1 en en 0 1 txd1/pa1 pin mux en 1 0 txd1 to scc1 16 bits to padat bit 1 output latch padir 16 bits papar en en 16 bits paodr open drain cntl en
parallel i/o ports 7-362 mc68360 user? manual motorola 7.14.6 port b pin functions refer to table 7-20 for the description of all port b pin options. all port b pins except pb17 and pb16 may be open-drain. port b pins are independently configured as a general-pur- pose i/o pins if the corresponding bit in the port b pin assignment register (pbpar) is cleared. they are configured as dedicated on-chip peripheral pins if the corresponding pbpar bit is set. when acting as a general-purpose i/o pin, the signal direction for that pin is determined by the corresponding control bit in the port b data direction register (pbdir). the port i/o pin is configured as an input if the corresponding pbdir bit is cleared; it is configured as an out- put if the corresponding pbdir bit is set. all pbpar bits and pbdir bits are cleared on total system reset, configuring all port b pins as general-purpose input pins. if a port b pin is selected as a general-purpose i/o pin, it may be accessed through the port b data register (pbdat). data written to the pbdat is stored in an output latch. if a port b pin is configured as an output, the output latch data is gated onto the port pin. in this case, when pbdat is read, the port pin itself is read. if a port b pin is configured as an input, data written to pbdat is still stored in the output latch but is prevented from reaching the port pin. in this case, when pbdat is read, the state of the port pin is read. all of the port b pins have more than one option. these options include on-chip peripheral functions relating to the idma, ethernet cam interface, spi, smc1, smc2, tdma, and tdmb. port b is also multiplexed with the pip. the pip is a cpm parallel port that can implement fast parallel interfaces, such as centronics. for a functional description of the dedicated pin functions of the pip, refer to 7.13 parallel interface port (pip). notes if the user does not use the pip, the description in this section is sufficient to describe the features of port b, and the pip descrip- tion does not need to be studied. the pip strbi and strbo pins are not listed in table 7-20. see 7.13 parallel interface port (pip) for instructions on how to enable them. pb3?b5 and pb16 have an unusual property in that their on-chip peripheral functions (brgo4, brgo3, brgo2, and brgo1) are repeated in port a. this gives an alternate way to output the brgo pins if other functions are used on port a. pb12?b15 have an unusual property in that their on-chip peripheral functions (such as rtsx or l1st1) are repeated in port c. this gives an alternate location to output these pins if other functions on port c are used.
parallel i/o ports motorola mc68360 user? manual 7-363 t note the user may freely configure any of the previous functions to be output onto two pins at once, although there is typically no ad- vantage in doing this (except in the case of a large fanout, where it is advantageous to share the load between two pins). 7.14.7 port b registers port b has four memory-mapped, read-write, 16-bit control registers. 7.14.7.1 port b open-drain register (pbodr). the pbodr is a 16-bit register that indicates a normal or wired-or configuration of the port pins. (bits 17 and 16 of pbodr do not exist.) pbodr is cleared at system reset. table 7-20. port b pin assignment pin function pbpar = 1 input to on-chip signal pbpar = 0 pbdir = 0 pbdir = 1 peripherals pb0 port b0 rrjct1 spisel v dd pb1 port b1 rstr2 spiclk spiclk = gnd pb2 port b2 rrjct2 spimosi v dd pb3 port b3 brgo4 spimiso spimiso = spimosi pb4 port b4 brgo1 dreq1 dreq1 = gnd pb5 port b5 brgo2 dack1 pb6 port b6 smtxd1 done1 done1 = v dd pb7 port b7 smrxd1 done2 v dd pb8 port b8 symsyn1 dreq2 gnd pb9 port b9 symsyn2 dack2 symsyn2 = gnd pb10 port b10 smtxd2 l1clkob pb11 port b11 smrxd2 l1clkoa smrxd2 = gnd pb12 port b12 l1st1 rts1 pb13 port b13 l1st2 rts2 pb14 port b14 l1st3 rts3/ l1rqb pb15 port b15 l1st4 rts4/ l1rqa pb16 port b16 brgo3 pb17 port b17 rstrt1 1514131211109876543210 od15 od14 od13 od12 od11 od10 od9 od8 od7 od6 od5 od4 od3 od2 od1 od0
parallel i/o ports 7-364 mc68360 user? manual motorola for each odx bit, the definition is as follows: 0 = the i/o pin is actively driven as an output. 1 = the i/o pin is an open-drain driver. as an output, the pin is actively driven low, but is three-stated otherwise. note smtxd1, done1 and done2 can not be set as open drain driv- er regardless of the setting of this register. 7.14.7.2 port b data register (pbdat). a read of pbdat returns the data at the pin, independent of whether the pin is defined as an input or an output. this allows detection of output conflicts at the pin by comparing the written data with the data on the pin. a write to the pbdat is latched, and if that bit in the pbdir is configured as an output, the value latched for that bit will be driven onto its respective pin. pbdat can be read or written at any time. pbdat is not initialized and is undefined at reset. 7.14.7.3 port b data direction register (pbdir). pbdir is cleared at system reset. for each drx bit, the definition is as follows: 0 = the corresponding pin is an input. 1 = the corresponding pin is an output. 7.14.7.4 port b pin assignment register (pbpar). pbpar is cleared at system reset. 1514131211109876543210 d15 d14 d13 d12 d11 d10 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 17 16 d17 d16 1514131211109876543210 dr15 dr14 dr13 dr12 dr11 dr10 dr9 dr8 dr7 dr6 dr5 dr4 dr3 dr2 dr1 dr0 17 16 dr17 dr16 1514131211109876543210 dd15 dd14 dd13 dd12 dd11 dd10 dd9 dd8 dd7 dd6 dd5 dd4 dd3 dd2 dd1 dd0 17 16 dd17 dd16
parallel i/o ports motorola mc68360 user? manual 7-365 for each ddx bit, the definition is as follows: 0 = general-purpose i/o. the peripheral functions of the pin are not used. 1 = dedicated peripheral function. the pin is used by the internal module. the on-chip peripheral function to which it is dedicated may be determined by other bits such as these in the pbdir. 7.14.8 port b example pb0 can be configured as a general-purpose i/o pin or as an open-drain pin. it may also be the receiver reject pin for the scc1 ethernet cam interface (rrjct1 ) or the spi select input (spisel ). if the pb0 pin is not configured to connect to the rrjct signal or the spisel signal, then the scc and/or spi receives v dd on that signal. note in the description of the pip, the pb0 pin, as well as other port b pins, can also be used as pip functions. however, the pip does not affect the operation of port b unless it is enabled. therefore, the pip description does not need to be studied by users of port b unless the pip will be used in the application. 7.14.9 port c pin functions port c consists of 12 general-purpose i/o pins with interrupt capability on each pin. refer to table 7-21 for the description of all port c pin options. table 7-21. port cpin assignment pcpar = 0 pcpar = 1 signal pcdir = 1 or pcso = 0 pcdir = 0 and pcso = 1 pcdir = 0 pcdir = 1 input to on-chip peripherals pc0 port c0 rts1 l1st1 pc1 port c1 rts2 l1st2 pc2 port c2 rts3/ l1rqb l1st3 pc3 port c3 rts4/ l1rqa l1st4 pc4 port c4 cts1 gnd pc5 port c5 cd1 tgate1 gnd pc6 port c6 cts2 gnd pc7 port c7 cd2 tgate2 gnd pc8 port c8 cts3 l1tsyncb sdack2 cts3 and/or l1tsyncb = gnd pc9 port c9 cd3 l1rsyncb gnd pc10 port c10 cts4 l1tsynca sdack1 cts4 and/or l1tsynca = gnd pc11 port c11 cd4 l1rsynca gnd
parallel i/o ports 7-366 mc68360 user? manual motorola all pcdir bits and pcpar bits are cleared on total system reset, configuring all port pins as general-purpose input pins. note that the global cimr is also cleared on total system reset so that, if any pcio pin is left floating, it will not cause a false interrupt. if a port c pin is selected as a general-purpose i/o pin, it may be accessed through the port c data register (pcdat). data written to the pcdat is stored in an output latch. if a port c pin is configured as an output, the output latch data is gated onto the port pin. in this case, when pcdat is read,the port pin itself is read. if a port c pin is configured as an input, data written to pcdat is still stored in the output latch but is prevented from reaching the port pin. in this case, when pcdat is read, the state of the port pin is read. to configure a port c pin an a general-purpose output pin, use the following steps. note that when the pin is configured as an output, port c interrupts are not possible. 1. write the corresponding pcpar bit with a zero. 2. write the corresponding pcdir bit with a one. 3. write the corresponding pcso bit with a zero (for the sake of clarity). 4. the corresponding pcint bit is a don? care. 5. write the pin value using the pcdat. to configure a port c pin as a general-purpose input pin that does not generate an interrupt, use the following steps: 1. write the corresponding pcpar bit with a zero. 2. write the corresponding pcdir bit with a zero. 3. write the corresponding pcso bit with a zero. 4. the corresponding pcint bit is a don? care. 5. write the corresponding cimr bit with a zero to prevent interrupts from being gener- ated to the cpu32+ core. 6. read the pin value using the pcdat. when a port c pin is configured as a general-purpose i/o input, a change according to the port c interrupt register (pcint) will cause an interrupt request signal to be sent to the cpm interrupt controller. each port c line can be programmed to assert an interrupt request upon a high-to-low change or any change. each port c line asserts a unique interrupt request to the cpm interrupt pending register and has a different internal interrupt priority level within the cpm interrupt controller. see 7.15 cpm interrupt controller (cpic) for more details. each request can be masked independently in the cpm interrupt mask register. to configure a port c pin an a general-purpose input pin that generates an interrupt, use the following steps: 1. write the corresponding pcpar bit with a zero. 2. write the corresponding pcdir bit with a zero. 3. write the corresponding pcso bit with a zero.
parallel i/o ports motorola mc68360 user? manual 7-367 4. set the pcint bit to determine which edges cause interrupts. 5. write the corresponding cimr bit with a one to allow interrupts to be generated to the cpu32+ core. 6. read the pin value using the pcdat. note these steps correspond to the ?oftware operation?mode of the scm diag bits on the mc68302. the port c lines associated with the cdx and ctsx pins have a mode of operation where the pin may be internally connected to the scc but may also generate interrupts. port c still detects changes on the cts and cd pins and asserts the corresponding interrupt request, but the scc simultaneously uses the cts and/or cd pin to automatically control operation. this allows the user to fully implement protocols v.24, x.21, and x.21 bis (with the assis- tance of other general-purpose i/o lines). to configure a port c pin as a cts or cd pin that is connected to the scc and also gener- ates interrupts, use the following steps: 1. write the corresponding pcpar bit with a zero. 2. write the corresponding pcdir bit with a zero. 3. write the corresponding pcso bit with a one. 4. set the pcint bit to determine which edges cause interrupts. 5. write the corresponding cimr bit with a one to allow interrupts to be generated to the cpu32+ core. 6. the pin value may be read at any time using pcdat. note after connecting the cts or cd pins to the scc, the user must also choose the ?ormal operation?mode in diag bits of the general scc mode register (gsmr) to enable and disable scc transmission and reception with these pins. 7.14.10 port c registers the user interfaces with port c via five registers. the port c interrupt control register (pcint) indicates how changes on the pin cause interrupts when interrupts are generated with that pin. the port c special options register (pcso) indicates whether certain port c pins have the ability to be connected to on-chip peripherals while simultaneously being able to generate an interrupt. the other three port c registers also exist on the other ports: pcdat, pcdir, and pcpar. since port c does not have open-drain capability, it does not contain an open-drain register.
parallel i/o ports 7-368 mc68360 user? manual motorola 7.14.10.1 port c data register (pcdat). when read, pcdat always reflects the current status of each line. 7.14.10.2 port c data direction register (pcdir). pcdir is a 16-bit register that is cleared at system reset. 7.14.10.3 port c pin assignment register (pcpar). pcpar is a 16-bit register that is cleared at system reset. 7.14.10.4 port c special options (pcso). pcso is a 16-bit read-write register. each defined bit in the pcso corresponds to a port c line (pc11?c4 and pc1?c0). the pcso is cleared at reset. bits 15?2, 3??eserved these bits should be written with zeros. cdx?arrier detect 0 = pcx is a general-purpose interrupt i/o pin. (the scc? internal cdx signal is al- ways asserted.) if pcdir configures this pin as an input, this pin can generate an interrupt to the cpu32+ core, as controlled by the pcint bits. 1 = pcx is connected to the corresponding scc signal input in addition to being a gen- eral-purpose interrupt pin. ctsx?lear-to-send 0 = pcx is a general-purpose interrupt i/o pin. (the scc? internal ctsx signal is al- ways asserted.) if pcdir configures this pin as an input, this pin can generate an interrupt to the cpu32+ core, as controlled by the pcint bits. 1 = pcx is connected to the corresponding scc signal input in addition to being a gen- eral-purpose interrupt pin. 1514131211109876543210 0000d11d10d9d8d7d6d5d4d3d2d1d0 1514131211109876543210 0000 dr11 dr10 dr9 dr8 dr7 dr6 dr5 dr4 dr3 dr2 dr1 dr0 1514131211109876543210 0000 dd11 dd10 dd9 dd8 dd7 dd6 dd5 dd4 dd3 dd2 dd1 dd0 1514131211109876543210 cd4 cts4 cd3 cts3 cd2 cts2 cd1 cts1
cpm interrupt controller (cpic) motorola mc68360 user? manual 7-369 extx?external request to the risc 0 = pcx is a general-purpose interrupt i/o pin, with the direction controlled in pcdir. if pcdir configures this pin as an input, this pin can generate an interrupt to the cpu32+ core, as controlled by the pcint bits. 1 = pcx becomes an external request to the risc controller instead of being a gener- al-purpose interrupt pin. the corresponding pcint bits control when a request is generated. note extx should only be set, if the user is instructed to do so, during the initialization of a motorola-supplied ram microcode. 7.14.10.5 port c interrupt control register (pcint). pcint is a 16-bit read- write register. each defined bit in the pcint corresponds to a port c line to determine whether the corresponding port c line will assert an interrupt request upon a high-to-low change or any change on the pin. the pcint is cleared at reset. bits 15?2?eserved. these bits should be written with zeros. edmx?dge detect mode for line x the corresponding port c line (pcx) will assert an interrupt request according to the fol- lowing: 0 = any change on pcx generates an interrupt request. 1 = high-to low change on pcx generates an interrupt request. 7.15 cpm interrupt controller (cpic) the cpic is the focal point for all interrupts associated with the cpm. the cpic accepts and prioritizes all the internal and external interrupt requests from all functional blocks associ- ated with the cpm. it is also responsible for generating a vector during the cpu interrupt acknowledge cycle. the cpic contains has the following key features: twenty-eight interrupt sources (16 internal and 12 external) sources may be assigned to a programmable interrupt level (1?) programmable priority between sccs two priority schemes for the sccs programmable highest priority request fully nested interrupt environment unique vector number for each interrupt source 1514131211109876543210 edm11 edm10 edm9 edm8 edm7 edm6 edm5 edm4 edm3 edm2 edm1 edm0
cpm interrupt controller (cpic) 7-370 mc68360 user? manual motorola 7.15.1 overview an overview of the quicc interrupt structure is shown in figure 7-99. the upper half of the figure shows the cpic. the cpic receives interrupts from internal sources such as the four sccs, the two smcs, the spi, the two idma controllers, the pip, the general-purpose tim- ers, and the port c parallel i/o pins. the cpic allows masking of each interrupt source. when multiple events within a cpm sub-block can cause the interrupt, each event is also maskable in that cpm sub-block. all cpm sub-block interrupt sources are prioritized, and bits are set in the cpm interrupt pending register (cipr). all 28 interrupt sources within the cipr are assigned one program- mable priority level (1?) before the request for an interrupt is sent to the imb. (on the mc68302, all interrupt sources are fixed at priority level 4; however, on the quicc, the inter- rupt level is programmable to be 1?.) within the cpm interrupt level, the 28 sources are assigned a priority structure. on the mc68302, the interrupts have a fixed priority structure; however, on the quicc, some flex- ibility is given to the user concerning the relative priority of the 28 interrupt sources. this flex- ibility is in two areas: 1) the ability to modify the relative priority of the sccs and 2) the ability to choose any interrupt source to be the highest of the 28 sources. once an unmasked interrupt source is pending in the cipr, the cpic sends an interrupt request to the imb. this request is at level 1, 2, 3, 4, 5, 6, or 7. the cpic then waits for an interrupt acknowledge cycle to occur on the bus. once an interrupt cycle occurs at the interrupt level that matches the cpic interrupt request, an interrupt arbitration begins on the imb. the interrupt arbitration process is designed to choose between multiple requests at the same level. for instance, if the cpm request is at level 4, but an external peripheral is simultaneously requesting service on the irq4 pin, an interrupt arbitration process is required to decide who wins the interrupt. (the interrupt arbi- tration process does not affect users who can assign all interrupt sources in the system to a unique interrupt level 1?.) in the interrupt arbitration process, the module places its arbitration id on the imb. the arbi- tration id ranges in value from 0?5. the cpic arbitration id is always fixed at 8. the higher arbitration value always wins. note the other source of interrupts on the quicc is the sim60, which has a programmable arbitration id (initially 15). thus, if a sim sub-block is programmed to the same interrupt level, then a higher sim60 arbitration id selects whether the sim60 has a higher interrupt priority than the cpm. assuming that the cpm wins the arbitration process, the cpm places its 8-bit vector on the bus, corresponding to the sub-block with the highest current priority. the vector is composed of two parts. the three msbs of the interrupt vector come from a 3-bit field in the cpm inter-
cpm interrupt controller (cpic) motorola mc68360 user? manual 7-371 rupt configuration register (cicr). the five lsbs are fixed in the cpic, and are unique for each cpic interrupt source. figure 7-99. quicc interrupt structure cpm priority resolver request to the imb at programmable level (1?) port c11?ort c0 timer1 timer2 timer3 timer4 scc1 scc2 scc3 scc4 smc1 smc2 spi pip idma1 idma2 sdma bus error risc timer table 12 32-bit cpm interrupt pending register (cpir) cpm vector generation logic interrupt arbitration id is fixed at level 8. 8-bit interrupt vector (lower 5 bits fixed, upper 3 bits programmable). 8 intermodule bus (imb) interrupt sources communication processor module (cpm) periodic interrupt timer (pit) software watchdog timer (swt) external to quicc irq7?rq1 7 sim60 interrupt control request to the imb level (1?) interrupt arbitration id is initially 15 (programmable) pit vector generation swt vector generation autovector generation 8-bit interrupt vector avec signal 8 quicc slave mode interrupt logic system integration module (sim60) iout2?out0 rqout 3 iack7?ack1 6 avec aveco
cpm interrupt controller (cpic) 7-372 mc68360 user? manual motorola 7.15.2 cpm interrupt source priorities the cpic has 28 interrupt sources that assert just one programmable interrupt request level to the cpu32+ core. the priority between all interrupt sources is shown in table 7-22. there is some flexibility in the relative ordering of the interrupts in the table, but, in general, the relative priorities are fixed in the descending order shown in the table. an interrupt from the parallel i/o line pc0 has the highest priority, and an interrupt from the parallel i/o line pc11 has the lowest priority. a single interrupt priority number is associated with each table entry. note the lack of sdma interrupt sources. the sdma-related interrupts are reported through each individual scc, smc, or spi channel. the only true sdma interrupt source is the sdma channel's bus error entry that is reported when a bus error occurs during an sdma access. there are two methods to add flexibility to the table of cpm interrupt priorities: the scc? relative priority option and the highest priority option. 7.15.2.1 scc relative priority. the relative priority between the four sccs is pro- grammable and can be dynamically changed. in table 7-22 there is no entry for scc1, scc2, scc3, or scc4, but rather there are entries for scca, sccb, sccc, and sccd because each of the sccs can be mapped to any of these locations. this is programmed in the cicr and may be dynamically changed. the user can utilize this on-the-fly capability to implement a rotating priority. in addition, the grouping of the locations of the scca, sccb, sccc, and sccd entries has two options: group and spread. in the group scheme, the sccs are all grouped together at the top of the priority table, ahead of most of the other cpm interrupt sources. this scheme is ideal for applications where all sccs function at a very high data rate and interrupt latency is very important. in the spread scheme, the scc priorities are spread over the table so that other sources can have lower interrupt latencies than the sccs. this scheme is also pro- grammed in the cicr, but it may not be dynamically modified. 7.15.2.2 highest priority interrupt. in addition to the scc relative priority option, the user may choose one interrupt source to be of highest priority. this highest priority inter- rupt is still within the same interrupt level as the rest of the cpic interrupts, but is simply serviced prior to any other interrupt in the table. if the highest priority feature is not used, select pc0 to be the highest priority interrupt, and no modifications to the standard interrupt priority order will occur. this highest priority source is dynamically programmable in the cicr. this allows the user to change a normally low priority source into a high priority source for a specified period of time.
cpm interrupt controller (cpic) motorola mc68360 user? manual 7-373 7.15.2.3 nested interrupts. the cpic supports a fully nested interrupt environment that allows a higher priority interrupt (from another cpm source) to suspend a lower priority interrupt? service routine. this nesting is achieved by the cpm interrupt in-service register (cisr). table 7-22. prioritization of cpm interrupt sources number priority level interrupt source description multiple events 1f highest parallel i/o?c0 no 1e scca (grouped and spread) yes 1d sccb (grouped) yes 1c sccc (grouped) yes 1b sccd (grouped) yes 1a parallel i/o?c1 no 19 timer 1 yes 18 parallel i/o?c2 no 17 parallel i/o?c3 no 16 sdma channel bus error yes 15 idma1 yes 14 idma2 yes 13 sccb (spread) yes 12 timer 2 yes 11 risc timer table yes 10 reserved yes f parallel i/o?c4 no e parallel i/o?c5 no d sccc (spread) yes c timer 3 yes b parallel i/o?c6 no a parallel i/o?c7 no 9 parallel i/o?c8 no 8 sccd (spread) yes 7 timer 4 yes 6 parallel i/o?c9 no 5 spi yes 4 smc1 yes 3 smc2/pip yes 2 parallel i/o?c10 no 1 parallel i/o?c11 no 0 lowest reserved
cpm interrupt controller (cpic) 7-374 mc68360 user? manual motorola the cpic prioritizes all interrupt sources based upon their assigned priority level. the high- est priority interrupt request is presented to the cpu32+ core for servicing. after the vector number corresponding to this interrupt is passed to the cpu32+ core during an interrupt acknowledge cycle, that interrupt request is cleared. if there are remaining interrupt requests, they are then prioritized, and another interrupt request may be presented to the cpu32+ core. the 3-bit mask in the cpu32+ status register ensures that a subsequent interrupt request at a higher interrupt priority level will suspend handling of a lower priority interrupt. the mask indicates the current processor priority, and interrupts are inhibited for all priority levels less than or equal to the current processor priority. the cisr and the mask register in the cpu32+ core can be used together to allow a higher priority interrupt within the same interrupt level to be presented to the cpu32+ core before the servicing of a lower priority interrupt is completed. each bit in the cisr corresponds to a cpm interrupt source. during an interrupt acknowledge cycle for a cpm interrupt, the in- service bit in the cisr is set by the cpic for that interrupt source. the setting of the bit pre- vents any subsequent cpm interrupt requests at this priority level or lower (within the cpic interrupt table), until the servicing of the current interrupt has completed and the in-service bit is cleared by the user. (pending interrupts for these sources are still set in the cpic dur- ing this time). thus, in the interrupt service routine for the cpm interrupts, the user can lower the core? mask to the next lower level (the level being serviced minus 1) to allow higher priority inter- rupts within this level to generate an interrupt request. this capability provides nesting of interrupt requests for cpm interrupt level sources in a similar manner as the cpu32+ core? interrupt mask provides nesting of interrupt requests for the seven interrupt priority levels. 7.15.3 masking interrupt sources in the cpm by programming the cpm interrupt mask register (cimr), the user may mask the cpm inter- rupts to prevent an interrupt request to the cpu32+ core. each bit in the cimr corresponds to one of the cpm interrupt sources. to enable an interrupt, write a one to the corresponding cimr bit. when a masked cpm interrupt source has a pending interrupt request, the corresponding bit in the cipr is still set, even though the interrupt is not generated to the cpu32+ core. by masking all interrupt sources in the cimr, the user may implement a polling interrupt ser- vicing scheme for the cpm interrupts. when a cpm interrupt source has multiple interrupting events, the user can individually mask these events by programming a mask register within that block. table 7-22 indicates the interrupt sources that have multiple interrupting events. figure 7-100 shows an example of how the masking occurs, using an scc as an example.
cpm interrupt controller (cpic) motorola mc68360 user? manual 7-375 figure 7-100. interrupt request masking 7.15.4 interrupt vector generation and calculation pending unmasked cpm interrupts are presented to the cpu32+ core in order of priority. the cpu32+ core responds to an interrupt request by initiating an interrupt acknowledge cycle to receive a vector number, which allows the core to locate the interrupt? service rou- tine. for cpm interrupts, the cpic passes an interrupt vector corresponding to the highest priority, unmasked, pending interrupt. the cpm always generates a vector during an inter- rupt acknowledge cycle at its interrupt level, regardless of whether the quicc is in normal mode or slave mode. the three msbs of the interrupt vector number are programmed by the user in the cimr. these three bits are concatenated with five bits generated by the cpic to provide an 8-bit vector number to the cpu32+ core. the cpic? encoding of the five low-order bits of the interrupt vector is listed in table 7-22. note that the interrupt vector table is the same as the cpm interrupt priority table except for two differences. first, the lower five bits of the scc vectors are fixed; they are not affected by the scc group or spread mode or the relative priority order of the sccs. second, an error scce event bit sccm mask bit 13 input or (13 event bits) cipr cimr mask bit 28 input or (28 cipr bits) request to the imb at the level specified in irl2?rl0 in the cicr.
cpm interrupt controller (cpic) 7-376 mc68360 user? manual motorola vector exists as the last entry in this table. the error vector is issued by the cpm if an inter- rupt was requested by the cpm but was masked by the user prior to being serviced by cpu32+ core and if no other pending interrupts for the cpm are present. the user should provide an error interrupt service routine, even if it is simply an rte instruction. table 7-23. encoding the interrupt vector interrupt number interrupt source description lower 5 bits of vector 1f parallel i/o?c0 11111 1e scc1 11110 1d scc2 11101 1c scc3 11100 1b scc4 11011 1a parallel i/o?c1 11010 19 timer 1 11001 18 parallel i/o?c2 11000 17 parallel i/o?c3 10111 16 sdma channel bus error 10110 15 idma1 10101 14 idma2 10100 13 reserved 10011 12 timer 2 10010 11 risc timer table 10001 10 reserved 10000 f parallel i/o?c4 01111 e parallel i/o?c5 01110 d reserved 01101 c timer 3 01100 b parallel i/o?c6 01011 a parallel i/o?c7 01010 9 parallel i/o?c8 01001 8 reserved 01000 7 timer 4 00111 6 parallel i/o?c9 00110 5 spi 00101 4 smc1 00100 3 smc2 / pip 00011 2 parallel i/o?c10 00010 1 parallel i/o?c11 00001 0 error 00000
cpm interrupt controller (cpic) motorola mc68360 user? manual 7-377 the following list gives an example of how to find the beginning of the interrupt handler from the interrupt vector. scc1 is used as an example. 1. formulate the 8-bit vector. the three msbs come from vba2?ba0 in the cicr. as- sume these are programmed to 101b. the five lsbs have a fixed value of 11110b (see table 7-22). thus, the 8-bit vector is 10111110b. this is the value presented on the bus during an interrupt acknowledge cycle. 2. multiply by 4 to get the offset address of the vector in the vector table. thus, the offset address is 1011111000b = $2f8. 3. determine the full vector address. in a cpu32+ system, the offset is added to the vec- tor base register in the cpu32+. assuming that the vector base register = $80000000, the final vector address is $800002f8. 4. determine the location of the interrupt handler. at location $800002f8, the address of the interrupt handler is stored. if the long word at location $800002f8 contains $80001000, then the first instruction of the scc1 interrupt handler will be found at $80001000. 7.15.5 cpic programming model the user interfaces with the cpic via four registers. the cicr defines the overall cpm interrupt attributes. the cipr indicates which cpm interrupt sources require interrupt ser- vice. the cimr allows the user to prevent any cpm interrupt source from generating an interrupt request. the cisr allows a fully nested environment capability for interrupt requests within the cpm interrupt level. 7.15.5.1 cpm interrupt configuration register (cicr). the 24-bit read-write cicr defines the request level for the cpm interrupts, the priority between the sccs, the highest priority interrupt, and the vector base address. the cicr, which can be dynamically changed by the user, is cleared at reset. scdp?ccd priority order these two bits define which scc will assert its request in the sccd priority position. the user should not program the same scc to more than one priority position (a, b, c, or d). these bits may be changed dynamically. 00 = scc1 will assert its request in the sccd position. 01 = scc2 will assert its request in the sccd position. 10 = scc3 will assert its request in the sccd position. 11 = scc4 will assert its request in the sccd position. 23 22 21 20 19 18 17 16 15 14 13 12 scdp sccp scbp scap irl2 irl1 irl0 hp4 11109876543210 ihp3 hp2 hp1 hp0 vba2 vba1 vba0 sps
cpm interrupt controller (cpic) 7-378 mc68360 user? manual motorola sccp?ccc priority order these two bits define which scc will assert its request in the sccc priority position. the user should not program the same scc to more than one priority position (a, b, c, or d). these bits may be changed dynamically. 00 = scc1 will assert its request in the sccc position. 01 = scc2 will assert its request in the sccc position. 10 = scc3 will assert its request in the sccc position. 11 = scc4 will assert its request in the sccc position. scbp?ccb priority order these two bits define which scc will assert its request in the sccb priority position. the user should not program the same scc to more than one priority position (a, b, c, or d). these bits may be changed dynamically. 00 = scc1 will assert its request in the sccb position. 01 = scc2 will assert its request in the sccb position. 10 = scc3 will assert its request in the sccb position. 11 = scc4 will assert its request in the sccb position. scap?cca priority order these two bits define which scc will assert its request in the scca priority position. the user should not program the same scc to more than one priority position (a, b, c, or d). these bits may be changed dynamically. 00 = scc1 will assert its request in the scca position. 01 = scc2 will assert its request in the scca position. 10 = scc3 will assert its request in the scca position. 11 = scc4 will assert its request in the scca position. irl2?rl0?nterrupt request level the irl field contains the priority request level of the interrupt from the cpm that is sent to the cpu32+ core. level 7 indicates a nonmaskable interrupt; level 0 indicates that all cpm interrupts are disabled. the irl field, therefore, acts as a master enable for the cpm interrupts in addition to specifying the interrupt priority level. the irl field is initialized to zero during reset to prevent the cpm from generating an interrupt until this register has been initialized. value $4 is a good value to choose for the irl field in most systems. notes in systems with multiple quiccs sharing the same system bus, assign these bits to a different request level in each quicc. if quicc is in slave mode (cpu32+ disabled), then the external irqx pin corresponding to the value programmed in irl2?rl0 should not be used. (for example, if irl2?rl0 has the value $5, then irq5 on this quicc should not be used externally.) this also applies to the programmable interrupt timer and soft- ware watchdog in the sim60 of the slave quicc.
cpm interrupt controller (cpic) motorola mc68360 user? manual 7-379 hp4?p0?ighest priority these bits specify the 5-bit interrupt number of the single cpic interrupt source that is to be advanced to the highest priority in the table. these bits may be dynamically modified. to keep the original priority order intact, simply program these bits to 11111. vba2?b0?ector base address these three bits are concatenated with five bits provided by the cpic for each specific interrupt source to form an 8-bit interrupt vector number. if these bits are not written, the uninitialized vector (value $0f) is provided for all cpm sources. these bits should not be dynamically modified. bits 4??eserved sps?pread priority scheme this bit, which selects the relative scc priority scheme, may not be changed dynamically. 0 = grouped. the sccs are grouped in priority at the top of the table. 1 = spread. the sccs are spread in priority throughout the table. 7.15.5.2 cpm interupt pending register (cipr). each bit in the 32-bit read-write cipr corresponds to a cpm interrupt source. when a cpm interrupt is received, the cpic sets the corresponding bit in the cipr. in a vectored interrupt scheme, the cipr clears the cipr bit when the vector number cor- responding to the cpm interrupt source is passed during an interrupt acknowledge cycle, unless an event register exists for that interrupt source. (event registers exist for interrupt sources that have multiple source events. for example, the sccs have multiple events that can cause an scc interrupt.) in a polled interrupt scheme, the user must periodically read the cipr. when a pending interrupt is handled, the user clears the corresponding bit in the cipr. (however, if an event register exists, the unmasked event register bits should be cleared instead, causing the cipr bit to be cleared.) to clear a bit in the cipr, the user writes a one to that bit. since the user can only clear bits in this register, bits written as zeros will not be affected. the cipr is cleared at reset. notes the scc cipr bit positions are not changed according to the relative priority between sccs (as determined by the scxp and sps bits in the cicr). no bit in the cipr is set if the error vector is issued. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 171 16 pc0 scc1 scc2 scc3 scc4 pc1 timer1 pc2 pc3 sdma idma1 idma2 timer2 r?t 1514131211109876543210 pc4 pc5 timer3 pc6 pc7 pc8 timer4 pc9 spi smc1 smc2 / pip pc10 pc11
cpm interrupt controller (cpic) 7-380 mc68360 user? manual motorola 7.15.5.3 cpm interrupt mask register (cimr). each bit in the 32-bit read-write cimr corresponds to a cpm interrupt source. the user masks an interrupt by clearing the corresponding bit in the cimr and enables an interrupt by setting the corresponding bit in the cimr. when a masked cpm interrupt occurs, the corresponding bit in the cipr is still set, regardless of the cimr bit, but no interrupt request is passed to the cpu32+ core. if a cpm interrupt source is requesting interrupt service when the user clears its cimr bit, the request will cease. if its cimr bit is later set by the user, a previously pending interrupt request will be processed by the cpu32+ core, according to its assigned priority. the cimr can be read by the user at any time. the cimr is cleared at reset. notes the scc cimr bit positions are not affected by the relative pri- ority between sccs (as determined by the scxp and sps bits in the cicr). to clear bits that were set by multiple interrupt events, the user must clear all the unmasked events in the corresponding event register. if a bit in the cimr is masked at the same time that the corre- sponding cipr bit causes an interrupt request to the imb, then the interrupt is not processed, but the error vector is issued if the interrupt acknowledge cycle occurs with no other cpm interrupts pending. thus, the user should always include an error vector routine, even if it just contains the rte instruction. the error vector cannot be masked. 7.15.5.4 cpm interrupt in-service register (cisr). each bit in the 32-bit read- write cisr corresponds to a cpm interrupt source. in a vectored interrupt environment, the cpic sets the cisr bit when the vector number corresponding to the cpm interrupt source is passed during an interrupt acknowledge cycle. the user? interrupt service routine must clear this bit after servicing is complete. (if an event register exists for this peripheral, its bits would normally be cleared as well.) to clear a bit in the cisr, the user writes a one to that bit. since the user can only clear bits in this register, bits written as zeros will not be affected. the cisr is cleared at reset. 31 30 29 28 27 26 25 24 23 22 21 20 19 18 171 16 pc0 scc1 scc2 scc3 scc4 pc1 timer1 pc2 pc3 sdma idma1 idma2 timer2 r?t 1514131211109876543210 pc4 pc5 timer3 pc6 pc7 pc8 timer4 pc9 spi smc1 smc2 / pip pc10 pc11 31 30 29 28 27 26 25 24 23 22 21 20 19 18 171 16 pc0 scc1 scc2 scc3 scc4 pc1 timer1 pc2 pc3 sdma idma1 idma2 timer2 r?t 1514131211109876543210 pc4 pc5 timer3 pc6 pc7 pc8 timer4 pc9 spi smc1 smc2 / pip pc10 pc11
cpm interrupt controller (cpic) motorola mc68360 user? manual 7-381 this register may be read by the user to determine which interrupt requests are currently in progress (i.e., the interrupt handler started execution) for each cpm interrupt source. more than one bit in the cisr may be a one if higher priority cpm interrupts are allowed to inter- rupt lower priority level interrupts within the same cpm interrupt level. for example, the timer2 interrupt routine could interrupt the handling of the timer3 routine, using a special nesting technique described earlier. during this time, the user would see both the timer3 and the timer2 bits simultaneously set in the cisr. notes the scc cisr bit positions are not affected by the relative pri- ority between sccs (as determined by the scxp and sps bits in the cicr). if the error vector is taken, no bit in the cisr is set. all undefined bits in the cisr return zeros when read. the user can control the extent to which cpm interrupts may in- terrupt other cpm interrupts by selectively clearing the cisr. a new interrupt will be processed if it has a higher priority than the higher priority interrupt having its cisr bit set. thus, if an inter- rupt routine lowers the 3-bit mask in the cpu32+ core to the cpm level minus one and also clears its cisr bit at the begin- ning of the interrupt routine, a lower priority interrupt can inter- rupt the higher one, as long as the lower priority interrupt is of higher priority than any other cisr bits that are currently set. 7.15.6 interrupt handler examples the following examples illustrate proper interrupt handling of cpm interrupts. nesting of interrupts within the cpm interrupt level is not shown in the following examples. 7.15.6.1 example 1?c6 interrupt handler. in this example, the cpic hardware clears the pc6 bit in the cipr during the interrupt acknowledge cycle. this is an example of a handler for an interrupt source without multiple events. 1. vector to interrupt handler. 2. handle event associated with a change in the state of the port c6 pin. 3. clear the pc6 bit in the cisr. 4. execute the rte instruction. 7.15.6.2 example 2?cc1 interrupt handler. in this example, the cipr bit scc1 remains set as long as one or more unmasked event bits remain in the scce1 reg- ister. this is an example of a handler for an interrupt source with multiple events. note that the bit in cipr does not need to be cleared by the handler, but the bit in cisr does need to be cleared. 1. vector to interrupt handler. 2. immediately read the scc1 event register (scce1) into a temporary location.
cpm interrupt controller (cpic) 7-382 mc68360 user? manual motorola 3. decide which events in the scce1 will be handled in this handler and clear those bits as soon as possible. (scce bits are cleared by writing ones.) 4. handle events in the scc1 rx or tx bd tables. 5. clear the scc1 bit in the cisr. 6. execute the rte instruction. if any unmasked bits in scce1 remain at this time (either not cleared by the software or set by the quicc during the execution of this handler), this interrupt source will be made pending again immediately following the rte in- struction.
cpm interrupt controller (cpic) 7-383 mc68360 user? manual motorola
cpm interrupt controller (cpic) 7-384 mc68360 user? manual motorola
motorola mc68360 user? manual 8-1 section 8 scan chain test access port the quicc provides a dedicated user-accessible test access port (tap) that is jtag com- patible. the quicc tap contains one additional signal not available with the mc68340 tap?he test reset (trst ) signal. this signal provides an asynchronous reset to the tap. the tap consists of five dedicated signal pins, a 16-state tap controller, and two test data registers. a boundary scan register links all device signal pins into a single shift register. the test logic, implemented utilizing static logic design, is independent of the device system log- ic. the quicc implementation provides the capability to: 1. perform boundary scan operations to test circuit-board electrical continuity. 2. bypass the quicc for a given circuit-board test by effectively reducing the boundary scan register to a single cell. 3. sample the quicc system pins during operation and transparently shift out the result in the boundary scan register. 4. disable the output drive to pins during circuit-board testing. note certain precautions must be observed to ensure that the ieee 1149.-like test logic does not interfere with nontest operation. see 8.6 non-scan chain operation for details. in addition to the scan-test logic, the quicc contains a signal that can be used to three-state all quicc output signals. this signal, called three-state (tris ), is sampled during system reset when the quicc is not in slave mode. 8.1 overview an overview of the quicc scan chain implementation is shown in figure 8-1. the quicc implementation includes a tap controller, a 3-bit instruction register, and two test registers (a 1-bit bypass register and a 196-bit boundary scan register). this implementation includes a dedicated tap consisting of the following signals: tck? test clock input to synchronize the test logic. tms? test mode select input (with an internal pullup resistor) that is sampled on the rising edge of tck to sequence the tap controller? state machine. tdi? test data input (with an internal pullup resistor) that is sampled on the rising edge of tck.
scan chain test access port 8-2 mc68360 user? manual motorola tdo? three-stateable test data output that is actively driven in the shift-ir and shift- dr controller states. tdo changes on the falling edge of tck. trst ?n asynchronous reset with an internal pullup resistor that provides initialization of the tap controller and other logic required by the standard. figure 8-1. test logic block diagram 8.2 tap controller the tap controller is responsible for interpreting the sequence of logical values on the tms signal. it is a synchronous state machine that controls the operation of the jtag logic. the state machine is shown in figure 8-2. the value shown adjacent to each arc represents the value of the tms signal sampled on the rising edge of the tck signal. boundary scan register bypass decoder tdo tdi tms tck trst 0 1 2 0 195 m u x m u x 3-bit instruction register tap ctlr
scan chain test access port motorola mc68360 user? manual 8-3 figure 8-2. tap controller state machine 8.3 boundary scan register the quicc scan chain implementation has a 196-bit boundary scan register. this register contains bits for all device signal and clock pins and associated control signals. the xtal, and xfc pins are associated with analog signals and are not included in the boundary scan register. all quicc bidirectional pins have a single register bit in the boundary scan register for pin data and are controlled by an associated control bit in this register. twenty-five bits in the boundary scan register define the output enable signal for associated groups of bidirectional and three-stateable pins. the control bits and their bit positions are listed in table 8-1. test logic reset run-test/idle select-dr_scan capture-dr shift-dr exit1-dr pause-dr exit2-dr update-dr select-ir_scan capture-ir shift-ir exit1-ir pause-ir exit2-ir update-ir 0 0 0 0 1 1 1 0 0 0 0 1 1 1 1 1 0 0 1 1 1 1
scan chain test access port 8-4 mc68360 user? manual motorola the boundary scan bit definitions are listed in table 8-2. the first column in the table defines the bit? ordinal position in the boundary scan register. the shift register cell nearest tdo (i.e., first to be shifted out) is defined as bit 0; the last bit to be shifted out is 195. the second column references one of the four quicc cell types depicted in figure 8-3 through , which describe the cell structure for each type. the third column lists the pin name for all pin-related cells or defines the name of bidirec- tional control register bits. the fourth column lists the pin type for convenience, where ts-output indicates a three- stateable output pin, i/o indicates a bidirectional pin, and od-i/o denotes an open-drain bidirectional pin. the last column indicates the associated boundary scan register control bit for bidirectional, three-state, and open-drain output pins. bidirectional pins include a single scan cell for data (io.cell) as depicted in figure 8-6. these bits are controlled by the cell shown in figure 8-5. the value of the control bit deter- mines whether the bidirectional pin is an input or an output. one or more bidirectional data cells can be serially connected to a control cell as shown in figure 8-7. note that, when sam- pling the bidirectional data cells, the cell data can be interpreted only after examining the io control cell to determine pin direction, and also note that the control cell captures the value of the following cell. table 8-1. boundary scan control bits name bit number name bit number name bit number g1.cntl 2 g10.cntl 32 pbhl.ctl 155 g2.cntl 5 add.cntl 59 pblh.ctl 159 g3.cntl 8 addh.cntl 83 pchh.ctl 170 g4.cntl 13 g11.cnt 89 pchl.ctl 174 g5.cntl 16 db.ctl 110 pclh.ctl 179 g6.cntl 18 pahh.ctl 131 g12.cntl 188 g7.cntl 23 pahl.ctl 136 g13.cntl 191 g8.cntl 27 palh.ctl 141 g14.cntl 194 g9.cntl 29 pbhh.ctl 150
scan chain test access port motorola mc68360 user? manual 8-5 table 8-2. boundary scan bit definition bit num cell type pin/cell name pin type output ctlcell bit num cell type pin/cell name pin type output ctlcell 0 i/o reseth i/o g1.ctl 39 output cs0 output 1 i/o bkpt i/o g1.ctl 40 output cs1 output 2 io.ctl g1.ctl 41 output cs2 output 3 i/o irq6 i/o g1.ctl 42 output cs3 output 4 i/o irq4 i/o g1.ctl 43 output cs4 output 5 io.ctl g2 .ctl 44 output cs5 output 6 i/o bgack ts-o g2.ctl 45 output cs6 output 7 i/o bg i/o g3.ctl 46 output cs7 output 8 io.ctl g3.ctl 47 input irq7 input 9 i/o br $ g4.ctl 48 input tris input 10 i/o nc1 i/o g4.ctl 49 i/o add0 i/o add.ctl 11 i/o ifetch i/o g5.ctl 50 i/o add1 i/o add.ctl 12 output oe output 51 i/o add2 i/o add.ctl 13 io.ctl g4.ctl 52 i/o add3 i/o add.ctl 14 i/o bclro i/o g5.ctl 53 i/o add4 i/o add.ctl 15 i/o nc2 i/o g5.ctl 54 i/o add5 i/o add.ctl 16 io.ctl g5.ctl 55 i/o add6 i/o add.ctl 17 i/o ipipe1 i/o g5.ctl 56 i/o add7 i/o add.ctl 18 io.ctl g6.ctl 57 i/o add8 i/o add.ctl 19 i/o as i/o g6.ctl 58 i/o add9 i/o add.ctl 20 output pipe0 i output 59 io.ctl add.ctl 21 i/o prty0 i/o g7.ctl 60 i/o add10 i/o add.ctl 22 i/o prty1 i/o g7.ctl 61 i/o add11 i/o add.ctl 23 io.ctl g7.ctl 62 i/o add12 i/o add.ctl 24 i/o prty2 i/o g7.ctl 63 i/o add13 i/o add.ctl 25 i/o prty3 i/o g7.ctl 64 i/o add14 i/o add.ctl 26 i/o dsack1 ts-o g8.ctl 65 i/o add15 i/o add.ctl 27 io.ctl g8.ctl 66 i/o add16 i/o add.ctl 28 i/o dsack0 ts-o g8.ctl 67 i/o add17 i/o add.ctl 29 io.ctl g9.ctl 68 i/o add18 i/o add.ctl 30 i/o nc3 i/o g9.ctl 69 i/o add19 i/o add.ctl 31 i/o r/w i/o g9.ctl 70 i/o add20 i/o add.ctl 32 io.ctl g10.ctl 71 i/o add21 i/o add.ctl 33 i/o ds i/o g10.ctl 72 i/o add22 i/o add.ctl 34 i/o freeze i/o g10.ctl 73 i/o add23 i/o add.ctl 35 output cas0 output 74 i/o add24 i/o add.ctl 36 output cas1 output 75 i/o add25 i/o add.ctl 37 output cas2 output 76 i/o add26 i/o add.ctl 38 output cas3 output 77 i/o add27 i/o add.ctl
scan chain test access port 8-6 mc68360 user? manual motorola 78 i/o nc4 i/o add.ctl 118 i/o data9 i/o db.ctl 79 input modclk1 input 119 i/o data8 i/o db.ctl 80 input modclk0 input 120 i/o data7 i/o db.ctl 81 i/o add28 i/o addh.ctl 121 i/o data6 i/o db.ctl 82 i/o add29 i/o addh.ctl 122 i/o data5 i/o db.ctl 83 io.ctl addh.ctl 123 i/o data4 i/o db.ctl 84 i/o add30 i/o addh.ctl 124 i/o data3 i/o db.ctl 85 i/o add31 i/o addh.ctl 125 i/o data2 i/o db.ctl 86 i/o siz0 i/o g11.ctl 126 i/o data1 i/o db.ctl 87 i/o siz1 i/o g11.ctl 127 i/o data0 i/o db.ctl 88 i/o fc0 i/o g11.ctl 128 i/o pa15 i/o pahh.ctl 89 io.ctl g11.ctl 129 i/o pa14 i/o pahh.ctl 90 i/o fc1 i/o g11.ctl 130 i/o pa13 i/o pahh.ctl 91 i/o fc2 i/o g11.ctl 131 io.ctl pahh.ctl 92 i/o fc3 i/o g11.ctl 132 i/o pa12 i/o pahh.ctl 93 i/o data31 i/o db.ctl 133 i/o pa11 i/o pahh.ctl 94 i/o data30 i/o db.ctl 134 i/o pa10 i/o pahh.ctl 95 i/o data29 i/o db.ctl 135 i/o pa9 i/o pahl.ctl 96 i/o data28 i/o db.ctl 136 io.ctl pahl.ctl 97 i/o data27 i/o db.ctl 137 i/o pa8 i/o pahl.ctl 98 i/o data26 i/o db.ctl 138 i/o pa7 i/o pahl.ctl 99 i/o data25 i/o db.ctl 139 i/o pa6 i/o pahl.ctl 100 i/o data24 i/o db.ctl 140 i/o pa5 i/o pahl.ctl 101 i/o data23 i/o db.ctl 141 io.ctl palh.ctl 102 i/o data22 i/o db.ctl 142 i/o pa4 i/o palh.ctl 103 i/o data21 i/o db.ctl 143 i/o pa3 i/o palh.ctl 104 i/o data20 i/o db.ctl 144 i/o pa2 i/o palh.ctl 105 output clko0 output 145 i/o pa1 i/o palh.ctl 106 output clko1 output 146 i/o pa0 i/o palh.ctl 107 i/o data19 i/o db.ctl 147 i/o pb17 i/o pbhh.ctl 108 i/o data18 i/o db.ctl 148 i/o pb16 i/o pbhh.ctl 109 i/o data17 i/o db.ctl 149 i/o pb15 i/o pbhh.ctl 110 io.ctl db.ctl 150 io.ctl pbhh.ctl 111 i/o data16 i/o db.ctl 151 i/o pb14 i/o pbhh.ctl 112 i/o data15 i/o db.ctl 152 i/o pb13 i/o pbhh.ctl 113 i/o data14 i/o db.ctl 153 i/o pb12 i/o pbhh.ctl 114 i/o data13 i/o db.ctl 154 i/o pb11 i/o pbhl.ctl 115 i/o data12 i/o db.ctl 155 io.ctl pbhl.ctl 116 i/o data11 i/o db.ctl 156 i/o pb10 i/o pbhl.ctl 117 i/o data10 i/o db.ctl 157 i/o pb9 i/o pbhl.ctl table 8-2. boundary scan bit definition
scan chain test access port motorola mc68360 user? manual 8-7 $=these pins are implemented differently in normal mode and in jtag mode?pen drain in normal mode, ts- o in jtag mode. figure 8-3. output latch cell (o.latch) 158 i/o pb8 i/o pbhl.ctl 177 i/o pc4 i/o pchl.ctl 159 i/o pb7 i/o pbhl.ctl 178 i/o pc3 i/o pclh.ctl 160 io.ctl pblh.ctl 179 io.ctl pclh.ctl 161 i/o pb6 i/o pblh.ctl 180 i/o pc2 i/o pclh.ctl 162 i/o pb5 i/o pblh.ctl 181 i/o pc1 i/o pclh.ctl 163 i/o pb4 i/o pblh.ctl 182 i/o pc0 i/o pclh.ctl 164 i/o pb3 i/o pblh.ctl 183 input irq2 input 165 i/o pb2 i/o pblh.ctl 184 input irq3 input 166 i/o pb1 i/o pblh.ctl 185 input irq5 input 167 i/o pb0 i/o pblh.ctl 186 i/o irq1 i/o g12.ctl 168 i/o pc11 i/o pchh.ctl 187 i/o berr $ g12.ctl 169 io.ctl pchh.ctl 188 io.ctl g12.ctl 170 i/o pc10 i/o pchh.ctl 189 i/o halt $ g13.ctl 171 i/o pc9 i/o pchh.ctl 190 i/o resets $ g13.ctl 172 i/o pc8 i/o pchh.ctl 191 io.ctl g13.ctl 173 i/o pc7 i/o pchl.ctl 192 i/o rmc i/o g14.ctl 174 io.ctl pchl.ctl 193 i/o avec ts-o g14.ctl 175 i/o pc6 i/o pchl.ctl 194 io.ctl g14.ctl 176 i/o pc5 i/o pchl.ctl 195 output perr $ g14.ctl table 8-2. boundary scan bit definition 1 1 mux g1 1 1 mux g1 c d c d from last cell clock dr update dr shift dr 1?xtest / clamp data from to output buffer 0?therwise logic system to next cell
scan chain test access port 8-8 mc68360 user? manual motorola figure 8-4. input pin cell (i.pin) figure 8-5. control cell (io.ctl) 1 1 mux g1 1 1 mux g1 c d c d from last cell clock dr update dr 1?xtest / clamp 0?therwise input pin shift dr to next cell data system logic c d c d to next cell to output from last cell clock dr update dr reset direction
scan chain test access port motorola mc68360 user? manual 8-9 figure 8-6. bidirectional data cell (io.cell) figure 8-7. general arrangement for bidirectional pins 1 1 mux g1 1 1 mux g1 c d c d to next cell from 1?xtest / clamp to output driver 0?ample from last cell clock dr update dr direction 1 1 mux g1 from i/o pin shift dr from io en ctl data from system logic 1 1 mux g1 1?xtest / clamp 0?therwise i/o pin control cell output control from system logic mode i/o pin note: more than one io.cell could be serially connected and controlled by a single io.ctl. * from last cell output data input data enable from direction ctl system logic io cell
scan chain test access port 8-10 mc68360 user? manual motorola 8.4 instruction register the quicc jtag implementation includes the public instructions (extest, sample/ preload, and bypass), and also supports the clamp instruction. one additional public instruction (hi-z) provides the capability for disabling all device output drivers. the quicc includes a 3-bit instruction register without parity consisting of a shift register with three par- allel outputs. data is transferred from the shift register to the parallel outputs during the update-ir controller state. the three bits are used to decode the five unique instructions listed in table 8-3. the parallel output of the instruction register is reset to all ones in the test-logic-reset con- troller state. note that this preset state is equivalent to the bypass instruction. during the capture-ir controller state, the parallel inputs to the instruction shift register are loaded with the clamp command code. 8.4.1 extest the external test (extest) instruction selects the 196-bit boundary scan register. extest also asserts internal reset for the quicc system logic to force a predictable benign internal state while performing external boundary scan operations. by using the tap, the register is capable of a) scanning user-defined values into the output buffers, b) capturing values presented to input pins, c) controlling the direction of bidirec- tional pins, and d) controlling the output drive of three-stateable output pins. for more details on the function and use of extest, refer to the scan chaindocument. 8.4.2 sample/preload the sample/preload instruction initializes the boundary scan register output cells prior to selection of extest. this initialization ensures that known data will appear on the out- puts when entering the extest instruction. the sample/preload instruction also pro- vides a means to obtain a snapshot of system data and control signals. in the case of the quicc, this functionality is not supported. note since there is no internal synchronization between the scan chain clock (tck) and the system clock (clko1), the user must table 8-3. instruction decoding code b2 b1 b0 instruction 0 0 0 extest 0 0 1 sample/preload x 1 x bypass 1 0 0 hi-z 1 0 1 clamp and bypass
scan chain test access port motorola mc68360 user? manual 8-11 provide some form of external synchronization to achieve mean- ingful results. note that in the quicc, the sample instruction is not function- al. 8.4.3 bypass the bypass instruction selects the single-bit bypass register as shown in figure 8-8. this creates a shift register path from tdi to the bypass register and, finally, to tdo, circumvent- ing the 196-bit boundary scan register. this instruction is used to enhance test efficiency when a component other than the quicc becomes the device under test. figure 8-8. bypass register when the bypass register is selected by the current instruction, the shift register stage is set to a logic zero on the rising edge of tck in the capture-dr controller state. therefore, the first bit to be shifted out after selecting the bypass register will always be a logic zero. 8.4.4 clamp the clamp instruction selects the single-bit bypass register as shown in figure 8-8, and the state of all signals driven from system output pins is completely defined by the data pre- viously shifted into the boundary scan register (for example, using the sample/preload instruction). 8.4.5 hi-z the hi-z instruction is provided as a manufacturer? optional public instruction to prevent having to backdrive the output pins during circuit-board testing. when hi-z is invoked, all output drivers, including the two-state drivers, are turned off (i.e., high impedance). the instruction selects the bypass register. note on the quicc, the tris pin may also be used during system re- set to perform the same function. 8.5 quicc restrictions the control afforded by the output enable signals using the boundary scan register and the extest instruction requires a compatible circuit-board test environment to avoid device- 1 1 mux g1 c d to tdo from tdi 0 shift dr
scan chain test access port 8-12 mc68360 user? manual motorola destructive configurations. the user must avoid situations in which the quicc output driv- ers are enabled into actively driven networks. the quicc includes on-chip circuitry to detect the initial application of power to the device. power-on reset (por), the output of this circuitry, is used to reset both the system and scan chainlogic. the purpose for applying por to the scan chaincircuitry is to avoid the possibility of bus contention during power-on. the time required to complete device power-on is power- supply dependent. however, the scan chaintap controller remains in the test-logic-reset state while por is asserted. the tap controller does not respond to user commands until por is negated. the quicc features a low-power stop mode, which is invoked using a cpu instruction called lpstop. the interaction of the scan chaininterface with low-power stop mode is as follows: 1. the tap controller must be in the test-logic-reset state to either enter or remain in the low-power stop mode. leaving the tap controller in the test-logic-reset state negates the ability to achieve low-power, but does not otherwise affect device functionality. 2. the tck input is not blocked in low-power stop mode. to consume minimal power, the tck input should be externally connected to v cc or ground. 3. the tms and tdi pins include on-chip pullup resistors. in low-power stop mode, these two pins should remain either unconnected or connected to v cc to achieve minimal power consumption. 8.6 non-scan chain operation in non-scan chain operation, there are two constraints. first, the tck input does not include an internal pullup resistor and should not be left unconnected to preclude mid-level inputs. the second constraint is to ensure that the scan chaintest logic is kept transparent to the system logic by forcing tap into the test-logic-reset controller state, using either of two methods. during power-up, por forces the tap controller into this state. after power-up is concluded, tms must be sampled as a logic one for five consecutive tck rising edges. if tms either remains unconnected or is connected to v cc , then the tap controller cannot leave the test-logic-reset state, regardless of the state of tck.
motorola mc68360 user? manual 9-1 section 9 applications 9.1 minimum system configuration this section describes a basic minimum system configuration for the quicc. it discusses the hardware and software issues of configurating the quicc to support a basic system with a variety of rom and ram types. 9.1.1 quicc hardware configuration these paragraphs discuss the hardware issues relating to the configuration of the quicc. reference figure 9-1 during these discussions. this configuration assumes a 32-bit data bus. comments about the changes required for a 16-bit data bus solution are given at the end of the discussion. 9.1.1.1 quicc basic accesses. the basic connection is made through the data and address bus. all 32 data lines are used in this application, although not all memories are a full 32-bits wide. twenty-eight address lines are used, giving a 256-mbytes address capability. it is possible to use all 32 address lines, but the quicc would then lose its write enable lines (we3 we0 ). since these lines are very useful in memory interfaces, they are used in the applica- tion. the function code (fc3?c0) and data strobe (ds ) lines are shown routed to the system bus, although the memories in this application do not require them. other pins not directly needed are dsackx , berr , sizx, perr , ipipex , and a number of chip selects. the dsackx lines are not required because the on-chip wait state generator is used. the berr pin is not needed because all bus errors are generated by internal mon- itor logic. the sizx pins are not needed because the memory controller has programmable port sizes for each memory bank. the perr pin is not needed because parity errors gen- erate bus errors. the ipipex pins are only needed for emulator support. the additional chip selects can be used to add additional peripherals as required.
applications 9-2 mc68360 user? manual motorola figure 9-1. mc68360 minimum system configuration mc68360 d31?0 a27?0 fc3?c0 as ds r/w oe we3?e0 dsack1?sack0 berr siz1?iz0 cs0 ras1 ras1dd cas3?as0 prty3?rty0 perr cs2 cs3 cs4 cs5 cs6 cs7 port a port b port c config2 config1 config0 reseth halt +5v 10k +5v 10k bkpt avec tris irq7?rq1 ipipe1?pipe0 tms tdi tdo tck trst +5v 4.7k vddsyn xfc clko1 clko2 +5v modck0 modck1 xtal extal +5v 4.7k to sram to eeprom to dram (simm or devices) to eprom (regular, or flash) & = pullups recommended (<= 10k) br bg bgack +5v +5v resets +5v 4.7k system bus & & & legend: +5v 4.7k & & & & 25mhz crystal oscillator & 400pf 0.1uf 0.01uf to vddsyn
applications motorola mc68360 user? manual 9-3 9.1.1.2 clocking strategy. in this application, the system clock is generated from a 32.768-khz crystal into the quicc. the quicc's internal phase-locked loop (pll) then multiplies the frequency up to 25 mhz, and outputs 25 mhz on clko1 and 50 mhz on clko2. neither clko pin is required for the application. it is recommended that the clko outputs be disabled in software to save power. the use of a 32.768-khz crystal is not a requirement in the application. a 4-mhz crystal or a 25-mhz external oscillator could have been used, if desired. the quicc clocking section allows for the clock oscillator to be kept running through the vddsyn pin in a power-down situation. this section does not address low-power issues, however. 9.1.1.3 resetting the quicc. if a quicc is configured to provide the global chip select, it will also provide an internal power-on reset generation. thus, the reset support function is very simple. if a pushbutton switch is needed, it can be connected by an open- drain buffer to the hard reset (reseth ) pin, once debounced. the soft reset (resets) pin is not used in this design except to indicate that an internal quicc soft reset is in progress. 9.1.1.4 interrupts. external interrupts may be brought into the quicc through either the irqx pins or parallel i/o pins. this design shows no external interrupts (the irq7?rq1 pins are pulled high), but this could be easily changed if desired. without any external inter- rupts requiring autovector capability, the avec pin is also pulled high. internal interrupts from the quicc may be generated in the sim60 or the cpm. no addi- tional hardware is required. 9.1.1.5 bus arbitration. this design assumes that no alternate bus masters exist in the system. thus, br is pulled high, and bgack is not connected, but pulled high since it is an open-drain signal. 9.1.1.6 breakpoint generation. the quicc can be used to generate a hardware breakpoint signal. the result of a breakpoint (either internally generated using the break- point address register or externally generated using the bkpt pin) is a cpu32+ breakpoint cycle. in this application, the bkpt pin is tied high and is not used. 9.1.1.7 bus monitor function. the quicc can be programmed to monitor the bus for bus cycles that are not properly terminated. if as is asserted but not negated, the cycle will terminate with the berr pin being asserted. 9.1.1.8 spurious interrupt monitor. the quicc will watch for spurious interrupt cycles on the levels that it supports internally. if such a condition occurs, berr will be asserted by the quicc. 9.1.1.9 software watchdog. if desired, the quicc software watchdog can be used to generate a level 7 interrupt or a system reset. in this application, the software watchdog is configured in software to generate a reset. no additional hardware is required.
applications 9-4 mc68360 user? manual motorola 9.1.1.10 double bus fault. the quicc double bus fault monitor may be used in the design. no additional hardware is required. 9.1.1.11 jtag and three-state. the quicc provides a jtag test access port, com- monly known as jtag. this interface uses five pins: tms, tdi, tdo, tck, and trst . tms and tdi are left unconnected because they have internal pullups. the jtag port is disabled in this application; however, the capability could be easily added. when the quicc is in master mode, it provides a pin (tris ) that allows all outputs on the device to be three-stated. this pin is simply pulled high in this application. 9.1.1.12 quicc serial ports. the functions on quicc parallel i/o ports a, b, and c may be used as desired in this application, and have no bearing on the design as shown. however, any unused parallel i/o pins should be configured as outputs so they are not left floating. 9.1.2 memory interfaces in this application, a number of memory arrays have been developed for eprom, flash eprom, sram, eeprom, and dram. each memory interface can be attached to the sys- tem bus as desired. one issue not discussed is the decision of whether external buffers are needed on the sys- tem bus. this issue depends on the number of memory arrays used in the design and the layout (i.e., capacitance) of the system bus. this issue is left to the user for his particular design. another issue left to the user is the number of wait states used with each memory system. this depends on the memory speed, whether external buffers are used, and the loading on the system bus pins. (the quicc provides capacitance de-rating figures to calculate the effect of additional or less capacitance on the ac timing specifications.) 9.1.2.1 quicc memory interface pins. in this design, a number of quicc pins are made available to the memory arrays (see figure 9-1). eight chip select or ras pins are available in the system. in this design, cs0 is used for any of the eprom arrays since this is the global (boot) chip select. ras1 is used for the dram arrays because of its double- drive capability. cs2 /ras2 is not used in the design and is available for other purposes, such as a second dram bank. cs3 is for sram; cs4 is for eeprom. cs5 , cs6, and cs7 are unused. parity may be supported for both sram and dram arrays using the 4-byte parity lines prty3?rty0. in this design, it is shown with only a dram. the quicc is configured in software to generate a bus error when a parity error occurs. the quicc provides the address multiplexing for the dram arrays internally, which is con- figured in software. therefore, the address multiplex pin is not needed, and it can be used as its other function?n output enable (oe ) pin. the dram arrays require the four cas3 cas0 pins provided by the quicc. the quicc also provides four write enable (we ) pins to select the correct byte during write operations.
applications motorola mc68360 user? manual 9-5 9.1.2.2 regular eprom. figure 9-2 shows the glueless interface to standard eprom in the system. in this case, an 8-bit boot eprom is used. all accesses to the eprom, even word or long-word length, will be partitioned into multiple byte accesses to the eprom. the fact that the config2?onfig0 pins are pulled high causes these pins to default to the 111 condition, selecting the cpu32+ core to be enabled, the cs0 pin to select a byte port size, and the mbar to be located in its normal address location. this is the most com- monly used configuration for the configx pins. the pullups are used to allow for some of the alternate functions of the configx pins to be used in later applications. during initialization, cs0 should be programmed to respond to a 128-kbyte area in this design. figure 9-2. glueless interface to standard eprom 9.1.2.3 flash eprom. figure 9-3 shows the glueless interface to a flash eprom device. it is identical to the regular eprom except that it allows for write operations as well. this design assumes that the write operations are ce controlled, rather than we controlled. most flash eprom manufacturers now support this alternative timing method. the fact that the configx pins are pulled high causes these pins to default to the 111 con- dition, selecting the cpu32+ core to be enabled, the cs0 pin to select a byte port size, and the mbar to be located in its normal address location. this allows a byte-sized eprom to be used without any external glue logic. dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 p ce (enable) oe byte port size d31ed24 a16ea0 cs0 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 +5v system bus and quicc-generated signals 27c010 128k 8 eprom
applications 9-6 mc68360 user? manual motorola during initialization, cs0 should be programmed to respond to a 256-kbyte area in this design. figure 9-3. glueless interface to flash eprom 9.1.2.4 sram. figure 9-4 shows the glueless interface to an sram. in this case, a full 32- bit-wide sram bank is assumed, but an 8- or 16-bit-wide bank would also be possible at the expense of performance. the cs3 pin should be programmed to respond to a 128-kbyte area in this design. we (write) dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 vpp ce (enable) oe system bus and quicc-generated signals byte port size d31ed24 a17ea0 cs0 oe we0 27f020 256k 8 flash eprom +12v a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17
applications motorola mc68360 user? manual 9-7 figure 9-4. glueless interface to sram 9.1.2.5 eeprom. figure 9-5 shows the glueless interface to an eeprom device to give a small amount of nonvolatile storage. in this case, a byte-wide eeprom bank is defined to minimize cost. if the port size of the chip select is selected to be 8-bits, then each byte of the 20 w (write) 22 27 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 e (enable) g (oe) 11 12 13 15 16 17 18 19 10 9 8 7 6 5 4 3 25 24 21 23 2 26 1 byte 2 middle-low byte d31ed24 20 w (write) 22 27 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 e (enable) g (oe) 11 12 13 15 16 17 18 19 10 9 8 7 6 5 4 3 25 24 21 23 2 26 1 d15ed8 20 w (write) 22 27 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 e (enable) g (oe) 11 12 13 15 16 17 18 19 10 9 8 7 6 5 4 3 25 24 21 23 2 26 1 d23ed16 20 w (write) 22 27 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 e (enable) g (oe) 11 12 13 15 16 17 18 19 10 9 8 7 6 5 4 3 25 24 21 23 2 26 1 byte 3 low-order byte d7ed0 cs3 cs3 cs3 cs3 oe we3 we2 we1 we0 oe oe oe a16ea2 a16ea2 a16ea2 a16ea2 mcm6206c 32k 8 static ram mcm6206c 32k 8 static ram byte 0 high-order byte byte 1 middle-order byte mcm6206c 32k 8 static ram mcm6206c 32k 8 static ram system bus and quicc-generated signals
applications 9-8 mc68360 user? manual motorola eeprom may be accessed in succession. the cs4 pin should be programmed to respond to an 8-kbyte area in this design. only one byte should be written at a time. after a write is made, software is responsible for waiting the appropriate time (e.g., 10 ms) or for performing data polling to see if the newly written data byte is correct. figure 9-5. glueless interface to eeprom 9.1.2.6 dram simm. figure 9-6 shows the glueless interface to an mcm36100s dram single in-line memory module (simm). the ras1 line should be programmed to respond to a 4-mbyte address space. this particular simm also includes parity support, which is supported with the prty3 prty0 signals. this design also uses the ras1 double-drive capability, whereby the ras1dd signal is out- put by the quicc to increase the effective drive capability of the ras1 signal. after power-on reset, the software must wait the required time before accessing the dram. the required eight read cycles must be performed either in software or by waiting for the refresh controller to perform these accesses. we (write) a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 ce (enable) oe 2864 8k 8 eeprom byte port size a12ea0 d31ed24 system bus and quicc-generated signals cs4 oe we0
applications motorola mc68360 user? manual 9-9 figure 9-6. glueless interface to mcm36100s sram 9.1.2.7 dram devices. figure 9-7 shows the glueless interface to standalone dram devices. in this case, the mcm54260 256k 16 dram device is chosen. this allows a full 32-bit-wide dram solution using only two dram devices, with byte writes still supported using the upper and lower cas pins. the ras1 line should be programmed to respond to a 1-mbyte address space. the address multiplexing scheme shown is the same as that for the dram simm. no parity support is provided in this case. the ras1dd signal is not used in this case since only two devices are supported. after power-on reset, the software must wait the required time before accessing the dram. the required eight read cycles must be performed either in software or by waiting for the refresh controller to perform these accesses. ma0 ma1 ma2 ma3 ma4 ma5 ma6 ma7 ma8 ma9 ras1 ras1dd cas0 cas1 cas2 cas3 r/w d7ed0 prty3 d15ed8 prty2 d23ed16 prty1 d31ed24 prty0 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 ras0 w system bus and quicc-generated signals mcm36100s 1m 36 bit dram module a11ea2 cas0 cas1 cas2 cas3 ras2 dq7edq0 dq8 dq16edq9 dq17 dq25edq18 dq26 dq34edq27 dq35 1m 4 1m 1 1m 1 1m 4 1m 4 1m 4 1m 4 1m 4 1m 1 1m 4 1m 4 1m 1
applications 9-10 mc68360 user? manual motorola figure 9-7. glueless interface to standalone dram 9.1.3 software configuration the following paragraphs discuss a number of key points for a software writer desiring to initialize the system. the items discussed are those that are required to enable the previous hardware configurations. 9.1.3.1 basic initialization. the following paragraphs describe the basic initialization procedures for the quicc. the module base address register (mbar) should be set as desired; however, it is unwise to allow the quicc 8-kbyte block of address space to overlap any memory array. the module base address register enable (mbare) should not be accessed. the module configuration register (mcr) should be set as desired. astm and bstm may be left cleared since their functions are not used in this system. the user should program ma0 ma1 ma2 ma3 ma4 ma5 ma6 ma7 ma8 dq15?q0 ras ucas lcas w mcm54260 256k 16 dram a0 a1 a2 a3 a4 a5 a6 a7 a8 d15?0 r/w cas2 bytes 2 & 3 low-order word cas3 ras1 ma0 ma1 ma2 ma3 ma4 ma5 ma6 ma7 ma8 dq15?q0 ras ucas lcas w a0 a1 a2 a3 a4 a5 a6 a7 a8 d31?16 r/w cas0 bytes 0 & 1 high-order word cas1 ras1 a10?2 system bus and quicc-generated signals mcm54260 256k 16 dram
applications motorola mc68360 user? manual 9-11 bclroid2?clroid0 to $3 and program the sdma, idma1, and idma2 arbitration ids in the sdma configuration register and idma channel configuration registers to 4, 2, and 0, respectively, to allow the sdma and dram refresh to preempt idma transfers. shen1 shen0 should be left cleared. supv should be cleared. bclriid2?clriid0 are not used and can be programmed to $0. iarb3?arb0 can be left programmed to $f to allow sim interrupts to have priority over cpm interrupts that occur at the same level. the software watchdog interrupt vector register (swiv) should be set as desired. in the system protection control register (sypcr), dbfe and bme should normally be set. if the software watchdog is not used, the swe bit should be cleared. the periodic interrupt control register (picr) may be set as desired. the breakpoint address register (bkar) and breakpoint control register (bkcr) should be set as desired. the port e pin assignment register (pepar) should be set to $0180. this configures the ras1dd pin, the wex lines instead of a31?28 lines, the four casx lines, cs7 , and avec . 9.1.3.2 configuring the memory controller. the following paragraphs describe configuring the memory controller registers. the global memory register (gmr) should be configured as follows: the rfcnt bits may be set as desired. at 25 mhz, an rfcnt value of 24 (decimal) gives one refresh every 15.6 m s. rfen should be set. rcyc depends on the dram speed. at 25 mhz (an 80-ns dram simm), rcyc should be 01. pgs2?gs0 should be set to 1m for the dram simm or to 256k for the 256k 16 dram devices. dps should be set to 00. wbt40 is not used and should be cleared. wbtq depends on timing; it should be set for 80-ns dram simms. dwq depends on timing. dw40 is not used and should be cleared. emws is not used in this design since there is only one quicc or mc68030-type bus master. it should be cleared. sync is not used in this design since there is only one quicc or mc68030-type bus master. it should be cleared. opar may be chosen by the user. pbee should be set to cause parity errors to generate bus errors. tss40 is not used and should be cleared.
applications 9-12 mc68360 user? manual motorola ncs should normally be cleared. dwq depends on timing. it must be set if page mode is used for the drams. dw40 is not used and should be cleared. amux should be set. the memory controller status register (mstat) is used for reporting parity errors and does not require initialization. the eight base registers (brs), one for each memory bank, should be configured as follows: the ba31?a11 bits may be set as desired. different memory arrays should not overlap. for simplicity, fc3?c0 can be cleared. trlxq should normally be cleared for memory interfaces. back40 is not used and should be cleared. csnt40 is not used and should be cleared. csntq should normally be cleared. paren should be set for memory banks that use parity. wp should be set for eprom, burst eprom, and flash eprom; otherwise, it should be cleared. v should be set if the memory bank is used. the eight option registers (ors), one for each memory bank, should be configured as fol- lows: the tcyc bits should be set to determine the number of wait states required. the am27?m11 bits should be programmed to determine the block size of the chip se- lect or rasx line. this should be the total number of bytes in each memory array. fcm3?cm0 may be set to all zeros to allow the chip select or rasx line to assert on all function codes except cpu space (interrupt acknowledge). it is advisable to program fcm3?cm0 to zeros, at least during the initial stages of debugging. bcyc1?cyc0 are not used and should be cleared. pgme may be set as desired to enable page mode if this is a dram bank. sps1?ps0 should be set to 10 for the byte-wide memory banks, such as eprom, and cleared for the 32-bit-wide memory banks. dssel should be set only if this is a dram bank. 9.1.3.3 using the quicc in 16-bit data bus mode. for systems that do not require a full 32-bit data bus capability, the quicc offers a 16-bit data bus mode. a system with 16- bit data bus mode is almost the same as the system shown in this section. only a few changes are required.
applications motorola mc68360 user? manual 9-13 to configure the quicc for 16-bit data bus mode, the system reset signal should be connected to the prty3 pin. in 16-bit data bus mode, the prty2 and prty3 pins are not used. all port sizes should be configured to either 8 or 16 bits. the dram port size must be 16-bits if internal address multiplexing is used. only the d31?16 pins should be connected to the system bus. only prty0 and prty1 should be used. the unused data and parity pins should be pulled high or low through a resistor to save power and to avoid floating inputs. only the upper word of the static ram array should be used. the cs3 line should be programmed to respond to a 64-kbyte address space. the dram simm should be replaced with a 16- or 18-bit-wide version. the ras1 line should be programmed to respond to a 2-mbyte address space. only the upper 256k 16 bit dram device should be used. the ras1 line should be programmed to respond to a 512-kbyte address space. 9.2 how to take a quicc software test-drive at first glance, the quicc has so many features that the proper initialization sequence may not be immediately obvious. the following paragraphs address the issue by showing the proper initialization sequence to use when configuring the quicc in a system after a power- up reset. included is a step-by-step sequence that will allow the user to use and learn each feature of the quicc in a methodical way. the sequence is applicable whether the quicc is in normal mode (cpu32+ enabled) or slave mode (cpu32+ disabled). although the sequence is designed as a first-time test-drive of the quicc, it is also useful as a general pattern for an overall quicc initialization. detailed information of a specific quicc hardware configuration and the actual values that should be written to registers may be found in 9.1 minimum system configuration and 9.4 using the quicc mc68040 companion mode . additionally, many examples of initializing certain peripherals are contained elsewhere in this manual where that peripheral is described. step 1: decide on reset stack pointer and initial program counter cs0 will function after reset and allow code execution from the boot eprom-type device. the stack pointer and the reset vector will be read from the first locations of the eprom, and the program will execute from eprom at the initial program counter address offset in the eprom. although the stack pointer is initialized, it is not ready to be used because it does not yet point to ram. step 2: stay in supervisor mode after a reset, m68000 family cpus are in supervisor mode. program accesses are issued with the supervisor program function code, and data accesses are issued with the supervi- sor data function code. these function codes are required for some of the operations that
applications 9-14 mc68360 user? manual motorola follow. (in embedded control applications, most users leave the cpu in supervisor mode permanently.) step 3: write the vbr many users initialize the rom to contain an initial exception vector table. if so, the user should write the cpu vector base register (vbr) to point to the starting location of the table. (the exception vector table defines where to find the routines that handle interrupts, bus errors, traps, etc.) note, however, that exceptions will not be ready to be handled properly until the stack pointer points to addressable ram. step 4: write the mbar the module base address register (mbar), which always exists at a fixed address, deter- mines where the 8-kbyte block of quicc internal ram and internal peripherals are to be mapped. to put the 8-kbyte block at $700000, write $00700001 to the mbar. the mbar must be accessed before any other quicc internal peripheral or ram location. remember that the mbar must be written in a special way as described in the section 6 system inte- gration module (sim60). (if multiple quiccs exist in the system, it may be necessary to write the mbare before writing mbar.) step 5: verify a dual-port ram location first, verify that the mbar address was programmed correctly. this can be done by testing one of the dual-port ram locations. write $33 and $cc to location $700000 and verify that these values can be correctly read. location $700000 is the beginning of the quicc internal ram. step 6: is this a power-up reset? next, determine the cause of the reset from the reset status register (rsr). the rsr is nor- mally cleared by the user after it is read (ones are written to rsr). if this is not a power-up reset, the user may wish to take actions other than the ones listed or notify the system of the cause of an unexpected reset to aid in debugging. many of the following steps are only nec- essary after a power-on reset. see section 4 bus operation for more details on the effects of the different types of resets. step 7: deal with the clock synthesizer the next step is to set up the clock synthesizer, which is located in the sim60. the three registers that control the clock synthesizer are the clkocr, the pllcr, and the cdvcr. if a low-speed external crystal is used (such as 32 khz or 4 mhz), multiply the quicc clock frequency up to the desired speed (e.g., 25 mhz). if an external oscillator is used to provide the exact system frequency, then this step is not needed. the clock synthesizer has other options, such as syncclk and brgclk dividers, as well as the ability to divide the general system clock frequency. these are used in low-power applications. at this time, leave all these options in their default conditions. these options should only be enabled when the rest of the application code is in a more stable state.
applications motorola mc68360 user? manual 9-15 as a further protection, the user may set the msb in the clock synthesizer registers, writing all other bits as zero. this will disable further writes to the clock synthesizer registers, pro- tecting them from inadvertent accesses by the program during the debugging phases. step 8: initialize system protection the next step is to protect the system with the bus monitor, double bus fault monitor, and software watchdog. the bus monitor and double bus fault monitor should be used during initial debugging. the software watchdog should be disabled at this time if it will not be used. step 9: clear entire dual-port ram after a power-on reset, the internal dual-port ram comes up in a random state. the user can avoid many potential problems if the entire dual-port ram is cleared at this time. this includes the 1762 bytes of internal system ram as well as the 768 bytes of parameter ram. by clearing the entire dual-port ram, the user can be sure that no feature is accidentally invoked just because it was not initialized. note it is critical that the user issue a cp reset command to the cr of the cpm after clearing the entire dual-port ram. the reset is re- quired to allow the risc to reinitialize its internal state variables for all serial channels, since these variables are stored in the dual-port ram and are not necessarily initialized to zeros. step 10: write the pepar the next important action is to configure the rest of the system bus pins by writing to the port e pin assignment register (pepar) in the sim60. in this register, the user will make a num- ber of choices about which functions are selected on the system bus (e.g., does the user want 32 address lines or 28 address lines and 4 write enable lines, etc.). step 11: remap chip select 0 up to this point, cs0 has been running with many wait states and has been mapped to the entire address space. it is now time to configure cs0 to the proper portion of memory con- trolled by the eprom and to reduce the number of wait states. this is accomplished by writ- ing the global memory register (gmr), option register 0 (or0), and base register 0 (br0) in the memory controller. note that the valid bit in the br0 should be set last. depending on the details of the application, most gmr bits do not affect cs0 , but it is a good idea to set up gmr before enabling any specific chip select on the quicc. gmr program- ming is discussed more fully in 9.1 minimum system configuration and 9.4 using the quicc mc68040 companion mode. step 12: initialize the system ram ensure that cs0 is programmed correctly?t least for these particular execution addresses.
applications 9-16 mc68360 user? manual motorola the next step is to configure the system ram. the address space for the ram should include the address of the stack pointer initialized during reset. (one other option would be to point the stack pointer into the quicc internal ram; however, this internal ram will prob- ably be used later for serial channel buffer descriptors. therefore, this idea is recommended only for the initial phases of debugging. (see step 3 discussed earlier.) once the system ram is initialized, it should be tested by the user to see if it exists at all intended addresses. step 13: copy the evt to system ram the exception vector table (evt) can be copied to system ram at this time to allow greater flexibility in choosing and modifying the exception vector values. most embedded operating systems require the evt to be located in ram. once the table is copied, the vbr should be modified to point to the beginning of the exception vector table in system ram, rather than pointing to rom. step 14: initialize all other memory and peripherals initialize the remaining csx and dram rasx pins in the memory controller. then test access to each memory and peripheral in the system. if dram is used, wait the appropriate time after power-up (usually around 100 m s) before accessing the dram. before writing the dram, the user normally must make the required number of read accesses (usually eight) to the dram using the cpu or must wait for the dram refresh controller to complete that number of refreshes. other initialization activity can proceed while waiting for the dram. step 15: initialize the rest of the sim60 the next step is to finish initializing the sim60 as desired. in particular, the module configu- ration register (mcr) has a number of "fine-tuning" choices that should be initialized. step 16: generate a sim60 interrupt the next step is to try an interrupt source. the simplest interrupt source on the quicc to try is the periodic interrupt timer (pit). it is completely controlled in software. to prepare for this interrupt, initialize the pit registers, but leave the timer disabled until everything else is ready. first, write the pirql0?irql2 bits in the picr with the desired interrupt level. suggestion: choose interrupt level 1. do not use level 7 for this interrupt, at least during initial stages of debugging. then write the piv bits in the picr to determine the vector. example: write $40 (64 decimal) to choose the first user-defined vector in the exception vector table. next, using the vbr value written in a previous step, write the address of the interrupt han- dler into the appropriate vector offset of the exception vector table. for instance, for vector number $40 and the vbr pointing to $800000, the interrupt handler address is written to $80000100. (the vector number is multiplied by 4 to obtain the offset.)
applications motorola mc68360 user? manual 9-17 note the exception vector table may have been located in rom, in which case the pit vector location should be initialized before power-on reset. also, before the interrupt can be processed, the cpu32+ status register (sr) must be pro- grammed to change the interrupt mask bits from a value of $7 to a value of $0 (or at least a value lower than the interrupt level desired). next, write the pitr bits in the pitr to start the timer and wait for the interrupt. step 17: test the cpm after the sim60 is programmed, it is time to begin testing the cpm. in order of increasing initialization complexity, the following sub-blocks may be tested. see the initialization exam- ples included in this manual where the blocks are described. dual-port ram parallel i/o ports a, b, and c baud rate generators four general-purpose timers risc timer tables idma (without buffer chaining) spi (loopback mode test) idma (with buffer chaining) smcs (loopback mode test) sccs (loopback mode without the time slot assigner) sccs (loopback mode with the time slot assigner) the spi, smcs, and sccs should be tested in loopback mode before attempting to send and receive data externally. step 18: generate interrupts with the cpm when testing interrupts on the cpm, the user should implement this gradually. first, gener- ate an interrupt with a timer or parallel i/o pin. then proceed to more complicated interrupt structures like the serial channels. step 19: enable external interrupts the next step is to allow external devices (if any) to interrupt the quicc. these interrupts can enter the quicc through the sim60 (irqx pins) or the cpm (parallel i/o pins with inter- rupt capability).
applications 9-18 mc68360 user? manual motorola step 20: enable external bus masters the final step in the initialization is to allow external bus masters (if any) to obtain ownership of the system bus. some of the characteristics of the quicc bus arbitration logic were cho- sen in the mcr of the sim60. the user should review these settings before continuing with this step. also, if an external bus master uses quicc resources such as chip selects, the settings of the gmr, brs, and ors in the memory controller should be reviewed before con- tinuing. step 21: off to the races the user has now successfully examined all major features of the quicc and can embark on a quick and successful product development cycle using the quicc. for applications desiring to port code from the mc68302, see 9.3 porting mc68302 imp code to the mc68360 quicc in this manual. 9.3 porting mc68302 imp code to the mc68360 quicc this subsection is designed as a guide for software engineers who desire to port software written for the mc68302 integrated multiprotocol processor (imp) to the mc68360 quicc. it discusses the mc68302 on a register-by-register basis and explains programming the same functions on the quicc. although the quicc contains a number of new features beyond the capabilities of the mc68302, the basic architectural approach is the same. although it will be necessary to modify the mc68302 initialization code and, in some cases, the register and bit names, a great effort was made to preserve the basic code flow. an example would be the basic flow of an interrupt handler or an error handler. thus, the knowledge that was obtained during the development of the mc68302 drivers need not be lost during the port to the quicc. 9.3.1 cpu and compilers the quicc contains a cpu32+ processor. this processor executes the m68000 code that was written on the mc68302; however, if such code was accessing mc68302 peripherals, it will require some modification. most m68000 compiler vendors also provide a cpu32 compiler. if the application code is recompiled using a cpu32 compiler, then an additional performance improvement will also be obtained due to the availability of additional cpu32 instructions over and above those of the m68000. also, using the quicc 32-bit data bus mode provides even further performance improve- ment. this is especially true if the original m68000 code used 32-bit pointers and data fields. the best performance improvement will occur when the objects are long-word aligned. 9.3.2 differences/similarities the 4-kbyte ram and peripheral area on the mc68302 is expanded to 8 kbytes on the quicc. since the quicc is an imb device, the initialization of the system integration mod- ule (sim60) is actually more similar to another imb-based device, such as the mc68340,
applications motorola mc68360 user? manual 9-19 than it is to the system integration block on the mc68302. the quicc communications fea- tures, however, are very similar to those of the mc68302. 9.3.3 notes about porting although the following paragraphs show how to port mc68302 functions to the quicc, it should not be assumed that the port operation will provide a complete initialization of the quicc. the quicc contains features not available on the mc68302 that may require addi- tional initialization. for instance, the quicc contains an on-chip pll to generate a high- speed system clock frequency from a low-speed crystal, such as a 32-khz crystal. since this feature is not available on the mc68302, it is not mentioned in this discussion. refer to 9.2 how to take a quicc software test-drive as a guide to complete quicc initialization. although the quicc was designed to allow a convenient upgrade path from the mc68302, this discussion does not guarantee that every mc68302 operation can be exactly and pre- cisely duplicated on the quicc. for instance, when using the serial channels, the time between setting the ready bit of a buffer descriptor and the assertion of the rts pin may not be the same on the quicc as the mc68302. also, although the mc68302 hardware watch- dog can be implemented in the quicc bus monitor, the mc68302 maximum timeout is 16k clocks; whereas, the quicc maximum timeout period is 1k clocks (before berr is asserted on the system bus). the quicc offers features that simplify what would otherwise be a more code-intensive pro- cess. for specific examples, see the init tx and rx parameters, the graceful stop transmit, and the close bd commands. the user can do a direct port using the old commands and techniques; however, the new commands may be used in many instances to simplify the application process. additionally, the most direct port to the quicc will not necessarily take advantage of a num- ber of new quicc features. for specific examples, see the dynamic allocation of scc inter- rupt levels and the buffer descriptor capability of the independent dma (idma) channels. some comments will be made about these features where appropriate. 9.3.4 how to port mc68302 functions the following paragraphs detail the different mc68302 functions and how/where to imple- ment them on the quicc. the mc68302 functions are listed in ascending order in the mc68302 memory map. 9.3.4.1 system configuration registers. the following paragraphs describe the mc68302 configuration registers. 9.3.4.1.1 base address register (bar). this register is most closely related to the mbar on the quicc: the base address field is configured in the ba bits of the mbar. be sure to allow 8 kbytes in the memory map of the quicc system at this address. also, the v-bit of mbar must be set before the contents are valid. the cfc bit and fc2?c0 bits may be duplicated by setting all but one of the as7?s0 bits in the mbar. note that the mbar offers many more options since multiple as bits
applications 9-20 mc68360 user? manual motorola may be simultaneously set. if cfc is zero, leave as7?s0 as zeros. 9.3.4.1.2 system control register (scr). the functions of this register are found in vari- ous places in the quicc. lpcd, lpen, lpp16, and lprec bits implement low-power functions in the mc68302. the quicc allows full operation at low speeds (due to its static design), as well as a num- ber of enhanced power reduction options and a special low-power stop instruction (lp- stop). the user should reference section 6 system integration module (sim60) for full details. the hwdcn2?wdcn0, hwden, and hwt bits are used to control and derive status from the mc68302 hardware watchdog. this function, called the bus monitor on the quicc, is part of the sim60. see the bme and bmt1?mt0 bits in the system protection control register (sypcr). the sam bit is used to control external masters that access the mc68302. this function is controlled in the sim60 by the bstm bit in the module configuration register (mcr). the frz2?rz1 and frzw bits control freeze operation. in the quicc, more freeze op- tions are available. see the freeze bits in the mcr of the sim60, the sdma configuration register (sdcr), timer global configuration register (tgcr), and the idma channel con- figuration register (iccr) of the cpm. the bclm bit and ipa bits are used to allow the m68000 core to give all interrupts higher priority than external bus masters. in the quicc, this function can be refined to just a range of interrupt levels. see the bclrism2?clrism0 bits in the mcr. the adce and adc bits determine the result (such as a berr assertion) of an overlap in the chip select ranges. this function is not available on the quicc. the emws bit adds an additional wait state for external masters that are accessing the mc68302 in a synchronous fashion and adds a wait state when external masters use mc68302 chip selects. this function is implemented in the dw40 and emws bits of the global memory register (gmr) in the quicc memory controller. the rmcst bit determines the m68000 bus functionality during the tas instruction and gives the option of exact mc68000-bus compatibility on the mc68302. on the quicc, this function is not required since an m68030-type bus is used. the mc68302 wpve and wpv bits are used to determine the result (such as a berr assertion) of a write operation to a read-only chip select. see the wper bit in the memory controller status register (mstat) for the quicc definition. the vge bit allows the mc68302 to generate vectors for interrupt acknowledge cycles while in slave mode. with quicc in slave mode, all internal interrupts generate vectors. for interrupts using the irqx pins, this decision is based on the autovector register. either a vector is placed on the bus, or the aveco pin is asserted (which can be ignored). the erre bit is used with the dram refresh controller on the mc68302. the quicc con- tains a full dram controller that does not require the assistance of the risc controller; therefore, this bit is not implemented in the quicc. the other status bits in this register were already discussed.
applications motorola mc68360 user? manual 9-21 9.3.4.2 system ram. the quicc contains 2560 bytes of dual-port ram rather than 576 bytes. both the mc68302 and the quicc split the dual-port ram into two parts: user data ram and parameter ram. the user data ram of the quicc may be used in the same way it is used in the mc68302. however, on the quicc, it has one major additional feature?t may be used to store buffer descriptors for serial data. (in fact, the quicc has no special location for buffer descriptors in the dual-port ram. they may be mapped anywhere.) thus, the user should plan on the user data ram being used for buffer descriptors, in addition to whatever the ram was being used for in the mc68302 application. the parameter ram of the mc68302 is very similar to the parameter ram on the quicc, except that there is no special location for buffer descriptors on the quicc. this gives the user the ability to choose the location and number of buffer descriptors for each serial chan- nel. the specific protocol parameter area of the mc68302 is available on the quicc. on the quicc there are four such areas; whereas, on the mc68302 there are only three. like the mc68302, each specific protocol parameter area is comprised of two parts? protocol independent part that is common to all sccs, regardless of their protocol, and a protocol specific part that is unique to each scc, based on the protocol. on the mc68302, the smcs and scp were given special locations for buffer descriptors and parameter areas. on the quicc, the smcs and spi are controlled like the sccs, with buffer descriptors that may be located anywhere in the user ram, and with a specific protocol parameter ram. in fact, all the quicc sccs, smcs, and spi have a common subset of parameter ram. the following description will discuss the buffer descriptors, protocol-independent parame- ter ram, and protocol-dependent parameter ram for the mc68302 and the quicc. 9.3.4.2.1 buffer descriptors. the buffer descriptors for the mc68302 and the quicc are essentially the same. the status and control field is a 16-bit field on both the mc68302 and the quicc. all bits are in their original positions with the following exceptions: the x-bit is removed, since the determination of an internal or external address is made by the full address decoding on the quicc. the user may still set this bit location without harm. in uart mode, the pm and a bits had to be moved. in bisync mode, the b-bit had to be moved. additional status and control bits were added on the quicc in previously unused bit positions. the data length field is identical between the mc68302 and the quicc. the data buffer pointer is the same between parts; however, on the quicc, all 32 bits are used. additionally, if the receive fifo is set to 32-bit-wide mode, then the data buffer pointer must be aligned to a long word. 9.3.4.2.2 protocol-independent parameter ram values. these values are very similar on both devices.
applications 9-22 mc68360 user? manual motorola the rbase and tbase values are new to the quicc. they point to the start of the buffer descriptor tables, must be long-word aligned, and must point to the dual-port ram area. the rfcr and tfcr registers have one additional purpose and a different bit placement on the quicc. if rfcr and tfcr are cleared on the mc68302 or not used with the mc68302, then the equivalent function on the quicc can be implemented by writing $18 to the quicc rfcr and tfcr. note that on the quicc there is an additional function code pin to signify dma operation, and the suggestion of $18 uses this capability. the mrblr value has the same function on both devices. additionally, if the receive fifo is set to 32-bit-wide mode, the mrblr value must be aligned to a long word. the internal state parameter has the same function on both devices. the mc68302 rbd# and tbd# have the same concept on the quicc, except the param- eters are called rbptr and tbptr and are now 16-bit values. they point to the current buffer descriptor; however, they are now offsets from the beginning location of the quicc dual-port ram. for example, the current transmit buffer descriptor location may be found by mbar + tbptr. the internal data pointer parameter has the same function on both devices. the internal byte count parameter has the same function on both devices. 9.3.4.2.3 protocol-dependent parameter ram values. these values are very similar between devices, although new functions are often added on the quicc. where possible, any parameter for a given protocol that is the same for the mc68302 and the quicc carries the same name on both devices. the following points note changes between the mc68302 and the quicc protocol-depen- dent parameter ram for a given protocol: in the uart mode, if the max_idl entry is programmed to $0000 on the quicc, the function will be disabled. in the uart mode, the ability to send special control characters, such as xoff, no longer requires the character8 entry. rather, a new entry, called the toseq entry, has been created. the programming of the toseq entry, however, is the same as the old mc68302 character8 entry. in uart mode, note the new parameters for a receive character mask (rccm) and a function that times the length of a receive break (brkln). the hdlc parameter ram is the same, except for two new entries: rfthr and rfcnt. they allow the user to reduce the number of received frame interrupts generated, and should be used in higher data rate applications. the bisync parameter ram is unchanged. ddcmp is a microcode ram product on the quicc. the port of ddcmp from the mc68302 is not discussed. v.110 is not supported on the quicc.
applications motorola mc68360 user? manual 9-23 for the transparent protocol, neither the mc68302 nor the quicc requires parameter ram for its implementation. the quicc, however, offers the new feature of allowing crcs to be generated and checked on transparent frames. in that case, the quicc's transparent parameter ram must be initialized. 9.3.4.3 internal registers (system integration block). both the mc68302 and the quicc have a number of internal registers. the following paragraphs detail the reg- isters according to their ascending order in the mc68302 memory map. note that the address offsets of these registers on the quicc are different from the address offsets on the mc68302. idma the mc68302 cmr is closely related to the quicc cmr. the str, rst, and bt bits are the same on both parts. the dsize bits are compatible, but on the quicc, an encoding exists for long-word size. the dapi, sapi, and reqg bits are the same. inte and intn are, in effect, moved to the cmar, but more control is given to the user. eco is in bit 15 of the quicc cmr. the quicc cmr contains new functions in the rci, s/d, and srm bits. sapr on the mc68302 is identical to sapr on the quicc. dapr on the mc68302 is identical to dapr on the quicc. bcr on the mc68302 is increased to 32 bits on the quicc. csr on the mc68302 is extended on the quicc. the done, bed, and bes bits are the same on both parts. the dns bit is not needed on the quicc. the quicc additionally contains the ob and brkp bits. the quicc contains a cmar that is not available on the mc68302. the fcr is the same on both parts, except that the quicc has a provision for four function code lines; whereas, the mc68302 only has three. interrupts the gimr on the mc68302 is most closely related to the quicc cicr and avr. the v7?5 bits become the vba2?ba0 bits. the et1, et6, and et7 bits control the edge/level sensitivity of the irq1 , irq6 , and irq7 pins on the mc68302. on the quicc, these pins are handled by the sim60. on the sim60, all irqx pins except irq7 are level sensitive. these bits do not exist on the quicc.
applications 9-24 mc68360 user? manual motorola the iv1, iv6, and iv7 bits are most closely related to the av1, av6, and av7 bits of the avr in the sim60. the mod bit does not exist on the quicc. on the quicc, the dedicated mode is used. on the quicc, new functions are available in the cicr such as a choice of the cpm inter- rupt level, a choice of the way the scc interrupts are grouped, and a choice of the highest priority cpm interrupt source. these functions were not available on the mc68302. the mc68302 ipr is increased to 32 bits and is called the cipr on the quicc. on the quicc, the sim60 can generate interrupts without using the cipr. the mc68302 imr is increased to 32 bits and is called the cimr on the quicc. the mc68302 isr is increased to 32 bits and is called the cisr on the quicc. parallel i/o ports the parallel i/o pin assignment is different on the quicc, but the three basic register types are carried over intact. the quicc has three i/o ports (a, b, and c); whereas, the mc68302 has two (a and b). the pxcnt control register on the mc68302 is the pxpar on the quicc. the pxddr data direction register is the same on both devices. the pxdat data latch and input register is the same on both devices. on the quicc, some of the parallel ports have an open-drain register, pxodr, which allows a port pin to be configured as an open-drain pin. chip selects the mc68302 contains four base registers (brx) and four option registers (orx) to control the chip selects. the quicc contains a global memory register (gmr), a memory status register (mstat), eight base registers (brx), and eight option registers (orx). the gmr would normally be initialized first on the quicc. also, the quicc chip selects contain many enhancements over the mc68302 chip selects not discussed here. the mc68302 brx register most closely corresponds to the quicc brx. the en bit becomes the v-bit in the quicc brx. the rw bit in the brx and the mrw bit in the orx of the mc68302 become the wp bit on the quicc brx. on the quicc, the choice exists for asserting the chip select for reads and writes (wp = 0) or just reads (wp = 1). the mc68302 base address bits a23?13 are found in ba31?a11 of the brx on the quicc. note that the quicc provides support for 32-bit address recognition (ba31 ba24 are new) as well as support for smaller starting address sizes (ba12?a11 are new), giving the ability to begin a block on a 2k address boundary, rather than 8k on the mc68302. to transfer a starting address from the mc68302 to the quicc, set any bit in
applications motorola mc68360 user? manual 9-25 ba23?a13 that was set in a23?13, and clear ba31?a24 and ba12?a11. the three function code (fc2?c0) bits become the four function code (fc3?c0) bits of the quicc orx. the mc68302 orx register most closely corresponds to the quicc orx. the cfc bit is implemented as the fcm3?cm0 bits on the quicc orx. this gives more flexibility in determining the function codes that cause the chip select to activate. if the mc68302 cfc bit was cleared, then clear fcm3?cm0 on the quicc. also, to match mc68302 behavior, clear the ncs bit in the quicc gmr. the mrw bit in the orx and the rw bit in the brx of the mc68302 simply become the wp bit on the quicc brx. on the quicc, the choice exists for asserting the chip select for reads and writes (wp = 0) or just reads (wp = 1). the mc68302 base address mask bits a23?13 become the am27?m11 bits in the quicc orx. note that this allows both larger and smaller block sizes than what the mc68302 provides. to transfer a block range, take bits a23?13 of the mc68302 and write them to am23?m13. then set am32?m24 and clear am12?m11. the three mc68302 dtack bits become the four tcyc3?cyc0 bits of the quicc orx. note that the maximum number of wait states is increased from 6 to 15 on the quicc. timers the mc68302 contains two general-purpose timers. the quicc contains four general-pur- pose timers, which are the same as the mc68302 timers, but slightly enhanced. the quicc also contains a timer global configuration register (tgcr), which allows all four timers to be enabled simultaneously and allows the timers to be internally cascaded into 32-bit timers. the mc68302 tmrx register most closely corresponds to the quicc tmrx. the rst bit is now located in the quicc tgcr. the iclk bits are still in the same location of the quicc tmr. the bit encodings are the same except for 00 combination, which is now implemented by the en bit in the quicc tgcr. the frr bit is still in the same location of the quicc tmr. the ori bit is still in the same location of the quicc tmr. the om bit is still in the same location of the quicc tmr, but the meaning of om = 0 mode can be different. the active-low pulse can be longer than on the mc68302, depend- ing on the frequency of the input clock source. the ce bits are still in the same location of the quicc tmr. the ps bits are still in the same location of the quicc tmr. the mc68302 trrx register is the same as the quicc trrx. the mc68302 tcrx register is the same as the quicc tcrx.
applications 9-26 mc68360 user? manual motorola the mc68302 tcnx register is the same as the quicc tcnx. the mc68302 terx register is the same as the quicc terx. watchdog timer the mc68302 timer 3 is called the watchdog timer. this software watchdog timer must be serviced periodically or can be used to generate a system reset. the software watchdog timer on the quicc exists in the sim60. it corresponds to the software watchdog available on other members of the mc68300 family. the wrr and wcn on the mc68302 do not have direct counterparts on the quicc. to program the software watchdog on the quicc, the user should initially program the sypcr, the swiv (optional), and service the software watchdog using the swsr. additionally, an indication of a software watchdog reset may be found in the rsr. 9.3.4.4 internal registers (communication processor). the following para- graphs detail the registers associated with the communications processor, according to their ascending order in the mc68302 memory map. note that the address offsets of the quicc registers are different than the offsets on the mc68302 registers. the 8-bit command register (cr) also exists on the quicc, but it is expanded to 16 bits. the flg bit still exists in the same location of the quicc cr. the two ch num bits have been shifted to bit locations 7 and 6 and expanded to four bits rather than two (bits 6 and 5 also), since more peripherals may now receive commands. if bits 6 and 5 are cleared, the scc channel number encodings are compatible from the mc68302 to the quicc. the two opcode bits have been increased to four bits, shifted left in the register, and redefined to include many more commands. however, the original commands available on the mc68302 are still available. the rst bit is shifted to become bit 15 of the quicc cr. to reset the mc68302, the val- ue $81 was issued to the cr. to reset the quicc, the value $8001 is issued to the cr. sccs the mc68302 scc registers are mapped to the quicc as follows. the sconx register controls the clocking scheme and baud rates of the mc68302 sccs. on the quicc, four independent baud rate generators that are not associated with specific sccs are available. therefore, this register is implemented in the quicc baud rate gener- ator and is called the brgc. note that the brgc contains new bits, including a reset bit and an enable bit. the div4 bit is now a divide-by-16 option and is implemented in the div16 bit of the quicc brgc. the cd10?d0 bits become cd11?d0 and are located in the quicc brgc. the rcs bit is implemented in the bank of clocks control in the three rxcs bits of the
applications motorola mc68360 user? manual 9-27 quicc serial interface clock route register (sicr). note that many more options are now available. the tcs bit is implemented in the bank of clocks control in the three txcs bits of the quicc sicr. note that many more options are now available. the extc bit becomes the extc1?xtc0 bits in the brgc. note that more options are now available. for compatibility, if the extc bit was cleared, then the extc1?xtc0 bits should also be cleared. the woms bit gives the mc68302 wired-or capability on the serial transmit data pin. this can now be implemented (as well as other wired-or capability) in the quicc pxo- dr registers, which can configure a pin to operate as wired-or, regardless of whether it is connected to the scc. the scm register is implemented using the general scc mode register (gsmr) and the protocol-specific mode register (psmr). one gsmr and one psmr exist for each scc. the definition of the psmr differs based on the protocol used. the two mode bits have been expanded to four mode bits in the gsmr to include the new protocols that the quicc provides. the ent bit still exists, but is shifted two bit positions left in the gsmr. the enr bit still exists, but is shifted two bit positions left in the gsmr. the diag bits still exist on the quicc but are shifted left two positions. normal operation = 00, loopback = 01, and automatic echo = 10 still exist on the quicc. software operation = 11 is now implemented by programming the pcpar, pcdir, pcodr, and pcint in the port c parallel i/o section. the new structure for software operation is much more flex- ible than on the mc68302 and provides hardware-updated, accurate, real-time status. since the software operation combination is not needed in the quicc diag bits in the gsmr, this combination is used to support a new feature, simultaneous loopback and echo. the rest of the scm bits differ based on protocol and are discussed in the following para- graphs by protocol. the uart mode register is now implemented using the gsmr and the psmr. one gsmr and one psmr exist for each scc. the definition of the psmr differs based on the protocol used. the sl bit is located in the psmr. the rtsm bit is located in the gsmr. the cl bit becomes two bits in the psmr for more character length options. the frz bit is located in the psmr. the um bits are located in the psmr. note that the 10 combination for asynchronous ddcmp is now reserved. the pen bit is located in the psmr. the one rpm bit becomes two rpm bits in the psmr for more receive parity options.
applications 9-28 mc68360 user? manual motorola the tpm bits remain the same and are located in the psmr. the hdlc mode register is implemented using the gsmr and the psmr. one gsmr and one psmr exist for each scc. the definition of the psmr differs based on the protocol used. the enc bit becomes the tenc and renc bits in the gsmr. note that the quicc con- tains many more data encoding options. the flg bit becomes the rtsm bit in the gsmr. the rte bit is located in the psmr. the fse bit is located in the psmr. the c32 bit becomes the two crc bits in the psmr. if c32 = 0, then initialize crc to 00. if c32 = 1, then initialize crc to 10. the nof bits are located in the psmr. the bisync mode register is implemented using the gsmr and the psmr. one gsmr and one psmr exist for each scc. the definition of the psmr differs based on the protocol used. the enc bit becomes the tenc and renc bits in the gsmr. note that the quicc con- tains many more data encoding options. the synf bit becomes the rtsm bit in the gsmr. the rbcs bit is located in the psmr. the rtr bit is located in the psmr. the bcs bit becomes the two crc bits in the psmr. if bcs = 0, initialize crc to 11. if bcs = 1, initialize crc to 01. the revd bit becomes the rvd bit in the psmr. note that the rvd bit in the psmr is not the same as the revd bit in the gsmr. the ntsyn bit should not have been set in bisync mode, and therefore is not ported. if the exsyn bit was set, the cdp and ctsp bit in the gsmr should be set for compat- ibility. the user may also wish to leave the cds and ctss bits cleared in the gsmr. the pm bit becomes the tpm and rpm bits in the psmr. note that more parity options are now available. note the synl bits in the gsmr were added to offer more synchro- nization options than are available on the mc68302. the ddcmp mode register is a microcode ram product on the quicc. the port of ddcmp from the mc68302 is not discussed in this section. the v.110 mode register is not supported on the quicc.
applications motorola mc68360 user? manual 9-29 the transparent mode register is implemented using the gsmr and the psmr. one gsmr and one psmr exist for each scc. the definition of the psmr differs based on the protocol used. the revd bit is located in the gsmr. the ntsyn bit becomes the ttx and trx bits in the gsmr. on the quicc the user can independently enable the totally transparent protocol to work on the receiver or transmitter while another protocol (such as hdlc) runs on the transmitter or receiver. if the exsyn bit was set, the cdp and ctsp bit in the gsmr should be set for compat- ibility. the user may also wish to leave the cds and ctss bits cleared in the gsmr. the user may wish to set the rsyn bit in the gsmr to remain compatible with the mc68302. note the synl bits in the gsmr were added to offer more synchro- nization options than are available on the mc68302. additional- ly, a crc may be generated in transparent mode using the tcrc bits. the data synchronization register (dsr) is also available on the quicc. when used in uart mode to generate fractional stop bits, the user should note that the encodings have changed slightly. the scc event register (scce) is also available on the quicc, but the register now has 10 bit positions to include new bit functions. the configuration of this register depends on the protocol mode. in uart mode, the rx, tx, bsy, ccr, brk, and idl bits exist unchanged. the cd and cts bits are no longer needed because the interrupt controller supports a separate vector for each event. in hdlc mode, the rxb, txb, bsy, rxf, txe, and idl bits exist unchanged. the cd and cts bits are no longer needed because the interrupt controller supports a separate vector for each event. in bisync mode, the rx, tx, bsy, rch, and txe bits exist unchanged. the cd and cts bits are no longer needed because the interrupt controller supports a separate vector for each event. ddcmp is a microcode ram product on the quicc. the port of ddcmp from the mc68302 is not discussed in this section. v.110 is not supported on the quicc. in totally transparent mode, the rx, tx, bsy, rch, and txe bits exist unchanged. the cd and cts bits are no longer needed because the interrupt controller supports a sepa- rate vector for each event. the scc mask register (sccm) is also available on the quicc, but the register now has 10 bit positions to include new bit functions. the configuration of this register depends on the protocol mode. since the sccm has the exact format as the scce, see the preceding scce description for details.
applications 9-30 mc68360 user? manual motorola the scc status register (sccs) is also available on the quicc. the configuration of this register depends on the protocol mode. in all cases, the cts and cd bits are available in the pcdat register, which allows the user to read the current value of these signals directly from the pins. additionally, the id bit is available in the quicc sccs register in uart and hdlc modes. note new status functions are available in the quicc sccs, such as whether the hdlc controller is currently receiving flags and the dpll carrier sense status. the 16-bit spmode register consists of two halves: the 8-bit smc mode register and the 8- bit scp mode register. the smcs on the quicc are much more similar to the sccs on the mc68302. to port an isdn (gci or iom2) application to the quicc that uses the mc68302 sccs, the user should use the features provided in the serial interface and smc. the quicc does not contain special support for idl in the smcs because idl no longer uses the a or m bits, but rather uses an out-of-band control bus called the scp. on the quicc, the scp function may be implemented with the spi. note on the quicc, the two smcs can also provide a uart or totally transparent control function. the scp on the quicc is enhanced to full serial peripheral interface (spi) functionality. the spi is found on many motorola devices, such as the mc68hc11. the 8-bit scp mode reg- ister is most closely related to the 16-bit spi mode register (spmode) on the quicc. the en bit is in the spmode register. the pm3?m0 bits are located in the spmode register. the ci bit is located in the spmode register. the loop bit is located in the spmode register. the str bit becomes the r-bit of the spi transmit buffer descriptor. the buffer descriptor structure of the spi is like that of the sccs. the simask register on the mc68302 is used in gci and idl modes to select individual bits of the b-channels to be routed to particular sccs. on the quicc, the serial interface has a time slot assigner that is much more flexible and can be used in any time division mul- tiplexed (tdm) interface, not just gci and idl. the time slot assigner on the quicc is pro- grammed using a feature called the serial interface ram. see 7.8.4 si ram. the simode register on the mc68302 controls the serial interface. on the quicc, the se- rial interface control is greatly enhanced and is comprised of the serial interface ram, the serial interface global mode register (sigmr), the serial interface mode register (simode),
applications motorola mc68360 user? manual 9-31 the serial interface clock route register (sicr), and the serial interface command register (sicmr). the ms bits select the serial interface mode on the mc68302: nmsi, idl, gci, and pcm highway. on the quicc, the choice is simply to enable or disable the time slot assigner. once the time slot assigner is enabled, it may be programmed in the si ram to implement idl, gci, pcm highway, and many other options. additionally, on the quicc, two tdm interfaces are simultaneously available, not just one. thus, on the quicc, the ms bits ef- fectively become the two enable bits, ena and enb, in the sigmr. the msc2 and msc3 bits are generalized on the quicc to the sc bits in the sicr. on the quicc, one sc bit exists for each scc. the drb and dra bit functions are implemented by programming the quicc si ram. the b1rb and b1ra bit functions are implemented by programming the quicc si ram. the b2rb and b2ra bit functions are implemented by programming the quicc si ram. the sdc1 and sdc2 bit functions as well as many other options are implemented by pro- gramming the quicc si ram. note that four strobe outputs are available on the quicc, not just two. the two sdiag bits are located in the quicc simode register and are renamed the sdm bits. furthermore, on the quicc, two sets of sdm bits exist to support tdma and tdmb. the sync bit function is implemented by programming the quicc si ram. the scit bit function is called the gm bit in the quicc simode register, and is available on both tdma and tdmb. the setz bit function is called the stz bit in the quicc simode register, and is avail- able on both tdma and tdmb. note the quicc does not require the use of the l1sy0 and l1sy1 pins to synchronize the scc to a given time slot. this is now handled by the time slot assigner using an external frame sync. thus, the quicc contains other programming options to specify the desired behavior of the frame sync and the associated exter- nal clocks. examples are the fe, ce, crt, dsc, and fsd bits in simode. 9.4 using the quicc mc68040 companion mode the following paragraphs describe how to increase the performance of a quicc-based sys- tem by using an mc68ec040 to replace the cpu32+ core on the quicc. when the cpu32+ core on the quicc is disabled, the quicc is in slave mode. in slave mode, another external processor may be used instead of the on-chip cpu32+ core. the quicc, however, has special features for providing a glueless interface to an external mc68ec040 (or other m68040 family member). this mode is called mc68040 companion mode.
applications 9-32 mc68360 user? manual motorola the following paragraphs discuss both the hardware and software issues concerning this solution in a system that contains one mc68ec040 and one quicc. it is also possible to interface more than one quicc to an mc68ec040. this topic is discussed briefly in para- graph 9.4.4 interfacing multiple quiccs to an mc68ec040 . 9.4.1 mc68ec040 to quicc interface the following paragraphs discuss the hardware and software issues relating to the connec- tion between the mc68ec040 and the quicc. the features of the quicc that may be used to assist the mc68ec040 are also detailed. reference figure 9-8 during this discussion. 9.4.1.1 mc68ec040 reads and writes to quicc. the basic connection is made through the data and address bus. all 32 data lines are routed between devices, which is required for the connection. in slave mode, the quicc is not allowed to use its 16-bit data bus mode. twenty-eight address lines are routed between devices, giving a 256-mbyte shared address capability. it is possible to share all 32 address lines between devices, but the quicc would then lose its write enable lines (we3 ?e0 ). these lines are very useful in memory inter- faces, and are used in this application. in the mc68040 companion mode, the quicc provides a number of signal changes to accommodate the mc68ec040. these changes allow direct connection between the mc68ec040 and the quicc. these quicc signals carry the same names as the compa- rable mc68ec040 signal: transfer start (ts ), transfer acknowledge (ta ), transfer exception acknowledge (tea ), transfer burst inhibit (tbi ), transfer type (tt1?t0), and transfer mode (tm2?m0). note the quicc monitors the address bus in slave mode to perform memory controller functions. therefore, the user should never gate 040 bus control signals (i.e., ta , ts signals) between 040 and quicc, even if the address output by the 040 is not con- trolled or used by the quicc. in addition, the quicc r/w and siz1?iz0 signals that are used in all configurations are directly connected to the mc68ec040. when the mc68ec040 begins an access, the quicc interprets the sizx pins, using the mc68ec040 encoding rather than the quicc encoding.
applications motorola mc68360 user? manual 9-33 figure 9-8. mc68ec040 to quicc interface d31?0 a27?0 a31?28 ts ta tea tbi r/w siz1?iz0 tt1?t0 tm2?m0 ipl2?pl0 avec br bg bb 4 mc68ec040 mc68360 d31?0 a27?0 ts/tris ta/dsack1 tea tbi/dsack0 r/w siz1?iz0 tt1?t0 tm2?m0 iout2?out0 aveco br bg bgack/bb tln1?ln0 upa1-0 locke ciout tip tci sc1?c0 mi cdis ipend pst3?st0 js1?s0 tms tdi tdo tck trst as we3?e0 cs0 ras1 cas3?as0 amux badd3?add2 prty3-prty0 perr irq5 cs3 cs4 cs5 cs6 cs7/iack7 irq2 irq3 port a port b port c 10k +5v 10k 10k +5v 10k +5v 10k +5v rsto rsti config2 config1 config0/lock reseth halt bclri +5v 10k +5v 10k bkpto irq7 tms tdi tdo tck trst +5v 10k vddsyn xfc extal clko1 clko2 bclk pclk +5v 400pf 0.1uf 0.01uf to vddsyn modck0 modck1 xtal 25 mhz osc +5v 4.7k to sram to eeprom to dram (simm or devices) to eprom (regular, burst, or flash) @ @ @ @ @ @ @ @ @ @ @ = pullups resistor (<= 10k) # = pulldowns resistor(<= 10k) # system bus to sram (optional) also ras1dd @ +5v 10k lock resets +5v 4.7k legend: +5v 10k * * = open collector +5v 10k +5v 10k +5v 10k resteh trst dq cp s r vcc iack7+reseth+resets
applications 9-34 mc68360 user? manual motorola 9.4.1.2 clocking strategy. in this application, the system clock is generated from a 25-mhz external oscillator into the quicc. the modckx pins are configured for this. the quicc internal pll then multiplies the frequency by 2, and outputs 25 mhz on clko1 (not used) and 50 mhz on clko2 (with minimal skew between extal, clko1, and clko2). minimal skew is very important in this application. the oscillator is connected to the mc68ec040 bclk, and the quicc extal and clko2 are connected to the mc68ec040 pclk. why not connect the oscillator to the quicc extal pin and connect the quicc clko1 to the mc68ec040 bclk? the answer is that the clko1 signal does not oscillate while the pll is locking during power-on reset, and the mc68ec040 needs continuous clocks, even during reset. (clko2, however, does oscillate at the extal frequency during power-on reset.) thus, this solution provides continuous clocks to the mc68ec040 at all times. an external low-frequency crystal cannot be used in this design because the clko1 and clko2 pins will stop oscillating while the pll relocks, which would occur when the software writes to the pll to multiply the system frequency up to 25 mhz. this would violate the mc68ec040 minimum operating frequency requirement of 16 mhz. the quicc clocking section allows for the clock oscillator to be kept running through the vddsyn pin in a power-down situation. low-power modes should not be used in this design due to the mc68ec040 requirement of a minimum operating frequency of 16 mhz. 9.4.1.3 reset strategy. if a quicc is configured to provide the global chip select, it will also provide an internal power-on reset generation. thus, the reset pin of the quicc just needs to be connected to the rsti pin on the mc68ec040. the rsto pin on the mc68ec040 is not used in this design; thus, the mc68040 reset instruction will have no effect. (it could be added by using an external reset circuit to reset the mc68ec040 and to connect the rsto to the reset pin on the quicc through an open-drain gate.) if a push- button switch is needed, it can be connected by an open-drain buffer to the hard reset (reseth ) line, once debounced. the soft reset (resets ) line is not used in this design. it could be used to reset the quicc without resetting the parallel i/o pins, chip selects, etc. 9.4.1.4 interrupts. external interrupts may be brought into the quicc through either the irqx pins or parallel i/o pins. the quicc prioritizes these interrupts with its own inter- nally generated interrupts (e.g., timers) to obtain the current highest pending request. in slave mode, the quicc can output this request to another processor in the system. note when the quicc is in slave mode, the user should not use an irqx pin that is on an interrupt level occupied by either the cpm, periodic interrupt timer, or sofware watchdog. the request can take the form of a single request pin (rqout ) or three request pins (iout2 ?out0 ) that encode the priority of the request. since the mc68ec040 uses encoded inputs (ipl2 ?pl0 ), the iout2 ?out0 pins are chosen.
applications motorola mc68360 user? manual 9-35 note if the mc68040 were used rather than the mc68ec040, the ipl2?pl0 pins take on meanings during reset to determine the buffer strength. thus, additional logic may be required during re- set to select the desired buffer strength of the mc68040. this logic does not exist on the mc68ec040 (except on very early versions of that device). in addition, the quicc allows the iout2 ?out0 pins to be generated in two different ways: at the expense of parity pins or at the expense of some interrupt requests. in this application, parity is used with some of the external memories; thus, three of the interrupt inputs are sac- rificed. once the mc68ec040 recognizes the interrupt, it responds with an interrupt acknowledge cycle. the quicc recognizes the mc68ec040 interrupt acknowledge cycle using the address pins, tt1?t0 pins (they are both high), and the tm2?m0 pins (which output the inverse of the value on ipl2 ?pl0 ). if the source of the interrupt is the cpm, the periodic interrupt timer, or the software watchdog, the quicc responds by placing the vector on the bus. if the source of the interrupt is an irqx pin, the quicc then responds by outputting the aveco signal to the mc68ec040, depending on what was programmed into the autovector register in the sim60. when the quicc is in slave mode, what is normally the avec pin (an input) becomes the aveco pin (an output) for use with external processors. 9.4.1.5 bus arbitration . when the quicc is configured to mc68040 companion mode, the quicc bus arbitration pins are configured to directly interface to those of the mc68ec040. the quicc bus request (br ) is an input from the mc68ec040, and the quicc bus grant (bg ) is an output to the mc68ec040. the quicc also has a bus busy (bb ) function to match that of the mc68ec040. the mc68ec040 lock pin can be connected to the quicc to allow mc68ec040 locked cycles to continue without interruption from the quicc. the config0 pin on the quicc becomes the lock input to the quicc after system reset when the quicc is in mc68040 companion mode. since the mc68ec040 lock pin is inactive high, it may be connected directly to the quicc lock pin with a pullup resistor. the br input from the mc68ec040 is not the highest priority in this system. the sdma channels have a higher priority. thus, the bclro function of the quicc is not used in this design because it is not needed. the quicc also has a bclri signal that allows internal masters to be cleared off the bus. this pin can be used with the mc68ec040 ipend pin to give the mc68ec040 interrupts priority over the quicc internal masters. this function is not implemented in the design for the sake of simplicity and use of the alternate function of the pin, the ras1dd function. however, if it were implemented, the ipend signal from the mc68ec040 would have to be latched and kept low by the mc68ec040 until completion of the interrupt routine. (if it was not latched, the quicc could take the bus back from the mc68ec040 as soon as the inter-
applications 9-36 mc68360 user? manual motorola rupt acknowledge cycle was complete, which defeats the purpose of connecting the ipend pin to the bclri pin.) when the quicc does not need the bus, it will assert the bg pin to the mc68ec040 con- tinually, improving the mc68ec040 memory access performance. 9.4.1.6 breakpoint generation . in mc68ec040 companion mode, the quicc can be used to generate a breakpoint signal using its breakpoint address register. this register will respond to quicc or mc68ec040 accesses, but only the first access of an mc68ec040 burst access. the result of a breakpoint is the assertion of the bkpto pin on the quicc. in this applica- tion, it was decided to route this output back to an interrupt input on the quicc and generate a nonmaskable interrupt to the mc68ec040. if the mc68ec040 encounters the breakpoint trap, it will respond with a breakpoint acknowledge cycle. the quicc does not recognize this cycle and takes no action. 9.4.1.7 bus monitor function . in mc68ec040 companion mode, the quicc will monitor the bus for bus cycles that are not properly terminated. the cycles can originate from the quicc or the mc68ec040. if the mc68ec040 originates such a cycle and that cycle times out without a ta or tea occurring, the quicc will assert tea back to the mc68ec040 to end the cycle. 9.4.1.8 spurious interrupt monitor . in mc68ec040 companion mode, the quicc will watch for spurious interrupt cycles generated by the mc68ec040, but only on the inter- rupt levels that the quicc supports internally (e.g., the levels used by the sim60 and the level of the cpm). if such a condition occurs, tea will be asserted by the quicc. 9.4.1.9 software watchdog . if desired, the mc68ec040 can program the quicc software watchdog to generate a level 7 interrupt or a system reset. in this application, the software watchdog is configured in software to generate a reset so that the breakpoint logic can use level 7 interrupts. no additional hardware is required because the connection between the reset pins of the quicc and the mc68ec040 is already made. 9.4.1.10 periodic interval timer . if desired, the mc68ec040 can use the periodic interval timer on the quicc to generate a system interrupt, such as for a real-time kernel. no additional hardware is required for this function. 9.4.1.11 mc68ec040 caching configuration . the mc68ec040 can cache or not cache data and can program memory as desired. however, it is strongly advisable not to cache the data that is accessed by the quicc serial channels because of the overhead incurred every time a cached data area is written. the mc68ec040 can decide to cache or not cache 16-byte portions of a bank of memory on a dynamic basis by using a software technique summarized in 9.5 selecting cache modes on the mc68ec040. 9.4.1.12 mc68ec040 snooping . the snooping function is not supported since only one active processor exists in the system and the quicc data buffers are not cached.
applications motorola mc68360 user? manual 9-37 9.4.1.13 double bus fault . in mc68040 companion mode, the quicc double bus fault monitor is not operational. 9.4.1.14 jtag and three-state . both the mc68ec040 and the quicc provide jtag test access ports, commonly known as jtag. this interface uses five pins: tms, tdi, tdo, tck, and trst . tms and tdi are left unconnected because they have internal pullups. the jtag ports of both parts are disabled in this application; however, the capability could be easily added. when the quicc is in master mode, it provides a tris pin that allows all outputs on the device to be three-stated. in slave mode, this feature is not available since the quicc is a peripheral of the system. thus, the transfer start (ts ) pin is available instead of the tris pin and does not conflict with it. 9.4.1.15 quicc serial ports . the functions on quicc parallel i/o ports a, b, and c may be used as desired in this application and have no bearing on the mc68ec040 inter- face. however, any unused parallel i/o pins should be configured as outputs so they are not left floating. 9.4.2 memory interfaces in this application, a number of memory arrays have been developed for eprom, burst eprom, flash eprom, eeprom, sram, burst sram, and dram. each memory inter- face can be attached to the system bus as desired. one issue not discussed is the decision of whether external buffers are needed on the sys- tem bus. this issue depends on the number of memory arrays used in the design and pos- sibly the layout (i.e., capacitance) of the system bus. another issue left to the user is the number of wait states used with each memory system. this depends on the memory speed, whether external buffers are used, and the loading on the system bus pins. (the quicc provides capacitance de-rating figures to calculate the effect of more or less capacitance on the ac timing specifications.) 9.4.2.1 quicc memory interface pins. in this design, a number of quicc pins are available to the memory arrays (see figure 9-8). these pins are active, regardless of whether the bus cycle was originated by the mc68ec040 or by one of the quicc dma cycles. the quicc detects the mc68ec040 bus cycle by the ts pin. if the quicc gener- ates the bus cycle, the quicc asserts the as pin. eight csx or rasx pins are available in the system. in this design, cs0 is used for any of the eprom arrays since it is the global (boot) chip select. ras1 is used for the dram arrays because of its double-drive capability. cs2 /ras2 is not used in the design and is available for other purposes, such as a second dram bank. cs3 is for sram arrays; cs4 is for eeprom. cs5 , cs6 , and cs7 are unused. in this design, it is assumed that the full 32-bit capability of the mc68ec040 is used; thus, all memory arrays are 32 bits wide. (the only exception to this is the eeprom, which is han-
applications 9-38 mc68360 user? manual motorola dled differently. see 9.4.2 memory interfaces . ) to provide dynamic bus sizing, the mc68150 device may be added to the design shown here. parity is supported for both sram and dram arrays using the four-byte parity lines prty3?rty0. when a parity error occurs, the error indication on the perr pin causes the quicc to generate a level 5 interrupt to the mc68ec040. (level 7 has already been used for the breakpoint generation interrupt.) the parity error timing is not fast enough to allow an mc68ec040 bus error to be generated on the bus cycle that generated a parity error. the quicc supports mc68ec040 bursting using the badd3?add2 pins. these pins nor- mally reflect the values on a3?2, but, in the case of a burst, are used to increment the address to the memory array. if the memory devices already support mc68ec040 bursting internally, the badd3?add2 pins are not required. the dram arrays require the four cas3 ?as0 pins. also, since an external address mul- tiplexer is used, the amux pin is required to select between rows and columns. if, however, the user's configuration does not require dram, the amux pin can be used as an oe pin instead. this would save an inverter in a number of memory arrays. note many memory arrays show an inverter on the r/w pin to create the oe signal. when using multiple memory arrays, it is possible to share one inverter between multiple memory arrays; however, this configuration is not shown. the quicc also provides four write enable (wex) pins to select the correct byte during write operations. 9.4.2.2 regular eprom. figure 9-9 shows the glueless interface to standard eprom in the system. the assumption is made that only the mc68ec040 will access this array. no bursting capability is used. the config2?onfig0 pins are configured to initialize the system to slave mode, cs0 operating on a 32-bit port at reset, the mbar at its normal loca- tion, and mc68040 companion mode. it would have been possible to use 16-bit-wide eprom to reduce the chip count, if desired. (see 9.4.2.3 burst eprom. for an example.) 9.4.2.3 burst eprom. figure 9-10 shows the glueless interface to two burst eproms available from national semiconductor. these devices support a glueless interface to the mc68040. in this design, the assumption is made that only the mc68ec040 will access this array.
applications motorola mc68360 user? manual 9-39 figure 9-9. 512-kbyte eprom bank?2 bits wide dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 p ce (enable) oe dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 p ce (enable) oe system bus and quicc-generated signals byte 2 middle-low byte byte 1 middle-high byte byte 0 high-order byte d31ed24 dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 p ce (enable) oe a18ea2 d15ed8 a18ea2 d23ed16 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 p ce (enable) oe byte 3 low-order byte a18ea2 d7ed0 a18ea2 cs0 27c010 128k 8 eprom cs0 cs0 cs0 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 +5v +5v +5v +5v 27c010 128k 8 eprom 27c010 128k x 8 eprom 27c010 128k x 8 eprom
applications 9-40 mc68360 user? manual motorola figure 9-10. 256-kbyte burst eprom bank?2 bits wide dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 dq8 dq9 dq10 dq11 dq12 dq13 dq14 dq15 r/w dsiz1 dsiz0 bclk ts ta ce0 ce1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 nm27c6841 64k 16 burst eprom bytes 2 & 3 low-order word a17ea2 d15ed0 system bus and quicc-generated signals clko1 r/w mode siz1 siz0 ts ta cs0 dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 dq8 dq9 dq10 dq11 dq12 dq13 dq14 dq15 r/w dsiz1 dsiz0 bclk ts ta ce0 ce1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 bytes 0 & 1 high-order word a17ea2 d31ed16 clko1 r/w mode siz1 siz0 ts ta cs0 nm27c6841 64k 16 burst eprom
applications 9-41 mc68360 user? manual motorola 9.4.2.4 flash eprom. figure 9-11 shows the interface to flash eprom devices. in this design, the assumption is made that only the mc68ec040 will access this array. the inverter is only required if dram is used elsewhere in the system, since the oe function is lost when the amux pin is used. this design assumes that the write operations are ce con- trolled, rather than we controlled. most flash eprom manufacturers now support this alter- native timing method. 9.4.2.5 regular sram. figure 9-12 shows the interface to sram. in this design, both the mc68ec040 and the quicc may access the sram array. the inverter is only required if dram is used elsewhere in the system, since the oe function is lost when the amux pin is used. this design also allows the quicc to support bursting by the mc68ec040 using the badd3?add2 signals. the quicc also uses these signals as a3?2 address lines during its normal sram accesses. if mc68ec040 bursting is not supported, the badd3 badd2 signals can be replaced with the a3?2 signals. 9.4.2.6 burst sram. figure 9-13 shows the interface to motorola's 32k 9 mcm62940a bursting sram. this can provide better memory throughput speeds than the regular sram array. figure 9-13 shows the solution for an array that is accessed by the mc68ec040 and the quicc. to speed access times, the chip select pin (s0) of the burst sram is connected directly to the a27 pin of the system bus. this gives half of the usable address space to this array, although this should not be a problem in most systems considering the 28 address pins available. no chip select pin from the quicc is used. the inverter on the r/w signal is only required if dram is used elsewhere in the system, since the oe function is lost when the amux pin is used. the clko1 signal is derived directly from the quicc clko1 pin. parity is also supported in the array, using the prty3 prty0 signals on the system bus. although not used in this design, motorola also offers a larger version of the mcm62940a, called the mcm67m618, that is organized into a 64k 18 array. in figure 9-13, the tsc pin is connected to the as pin to handle the quicc accesses. the quicc accesses do not use the bursting feature of the mcm62940a. baa , which could be asserted during the quicc accesses due to the quicc dsack1 being multiplexed with the mc68ec040 ta , is a don't care as long as tsc remains low. after tsc negated, the oe and we signals are negated, disabling the mc62940a burst
applications 9-42 mc68360 user? manual motorola . figure 9-11. 1-mbyte flash eprom bank?2 bits wide we (write) dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 vpp ce (enable) oe system bus and quicc-generated signals byte 2 middle-low byte byte 1 middle-high byte byte 0 high-order byte d31?24 we (write) dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 vpp ce (enable) oe d15?8 we (write) dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 vpp ce (enable) oe d23?16 we (write) dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 vpp ce (enable) oe byte 3 low-order byte a19?2 d7?0 a19?2 cs0 r/w oe we3 we2 we1 we0 oe oe oe 27f020 256k x 8 flash eprom cs0 cs0 cs0 +12v +12v +12v +12v a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 27f020 256k x 8 flash eprom 27f020 256k x 8 flash eprom 27f020 256k x 8 flash eprom a19?2 a19?2
applications 9-43 mc68360 user? manual motorola figure 9-12. 128-kbyte static ram bank?2 bits wide 20 w (write) 22 27 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 e (enable) g (oe) 11 12 13 15 16 17 18 19 10 9 8 7 6 5 4 3 25 24 21 23 2 26 1 system bus and quicc-generated signals byte 2 middle-low byte byte 1 middle-high byte byte 0 high-order byte d31ed24 20 w (write) 22 27 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 e (enable) g (oe) 11 12 13 15 16 17 18 19 10 9 8 7 6 5 4 3 25 24 21 23 2 26 1 d15ed8 20 w (write) 22 27 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 e (enable) g (oe) 11 12 13 15 16 17 18 19 10 9 8 7 6 5 4 3 25 24 21 23 2 26 1 d23ed16 20 w (write) 22 27 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 e (enable) g (oe) 11 12 13 15 16 17 18 19 10 9 8 7 6 5 4 3 25 24 21 23 2 26 1 byte 3 low-order byte d7ed0 cs3 cs3 cs3 cs3 r/w oe we3 we2 we1 we0 oe oe oe mcm6206c static ram a16ea4, badd3, badd2 a16ea4, badd3, badd2 mcm6206c static ram mcm6206c static ram mcm6206c static ram 32 8 32 8 32k 8 32k 8 a16ea4, badd3, badd2 a16ea4, badd3, badd2
applications 9-44 mc68360 user? manual motorola figure 9-13. 128-kbyte burst sram bank?2 bits wide dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 dq8 k s0 g (oe) w (write) tsp baa dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 dq8 k s0 g (oe) w (write) tsp baa a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 system bus and quicc-generated signals byte 2 middle-low byte byte 1 middle-high byte byte 0 high-order byte d31ed24 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 d15ed8 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 d23ed16 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 byte 3 low-order byte a16ea2 d7ed0 a16ea2 we3 we1 we0 mcm62940a 32k 9 burst sram s1 prty2 prty3 prty1 prty0 tsc a27 clko1 dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 dq8 k s0 g (oe) w (write) tsp baa clko1 a27 as clko1 a27 dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 dq8 k s0 g (oe) w (write) tsp baa goe we2 a27 clko1 s1 s1 s1 reset d clock set q1 74f74 +5v clko1 ta delayed ta ts mux 1 0 sel ta y r/w delayed ta on writes tsc as tsc as tsc as +5v r/w goe goe goe generated oe mcm62940a 32k 9 burst sram mcm62940a 32k 9 burst sram mcm62940a 32k 9 burst sram a16ea2 a16ea2
applications 9-45 mc68360 user? manual motorola 9.4.2.7 eeprom. figure 9-14 shows the interface to an eeprom device to give a small amount of nonvolatile storage. although both the mc68ec040 and the quicc may access the eeprom, it is most likely that only the mc68ec040 will access the eeprom. the inverter is only required if dram is used elsewhere in the system, since the oe function is lost when the amux pin is used. the eeprom device sits on just the d7?0 data pins. thus, when the mc68ec040 accesses the eeprom, the only valid data that is read or written is on the d7?0 pins (i.e., byte 3). thus, reads or writes to successive locations of the eeprom will require the address to be incremented by 4 each time. additionally, the cs4 pin should be programmed to respond to a full 32-kbyte area, even though only 8 kbytes are present. after a write is made, software is responsible for waiting the appropriate time (e.g., 10 ms) or for performing data polling to see if the newly written data byte is correct. figure 9-14. 8-kbyte eeprom bank? bits wide 9.4.2.8 dram simm. figure 9-15 shows the interface to an mcm36100s dram single in- line memory module (simm). both the mc68ec040 and the quicc can access the dram. when the quicc is a slave to an external mc68ec040, the address multiplexing for the dram must be done externally to the quicc, which is accomplished in the three f157 mul- tiplexers. the external address multiplexing scheme was chosen to allow the quicc to pro- vide burst accesses by the mc68ec040, using the badd3?add2 pins. the quicc can also use these pins as its a3?2 address lines during its own accesses to the dram. in addition, two of the multiplexer outputs are unused in this design, allowing expansion to we (write) a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 ce (enable) oe 2864 8k 8 eeprom a14ea2 d7ed0 system bus and quicc-generated signals cs4 r/w we3 byte 3 low-order byte
applications 9-46 mc68360 user? manual motorola future 16m 36 dram simms. in fact, this multiplexing scheme allows simms of many dif- ferent sizes to be used on the board without hardware modification. this particular simm also includes parity support, supported with the prty3?rty0 sig- nals. this design also uses the ras1 double-drive capability, whereby the ras1dd signal is out- put by the quicc to increase the effective drive capability of the ras1 signal. the ras1 line should be programmed to respond to a 4-mbyte address space. after power-on reset, the software must wait the required time before accessing the dram. the required eight read cycles must then be performed either in software or by waiting for the refresh controller to perform these accesses. 9.4.2.9 dram devices. figure 9-16 shows the interface to a standalone dram device. in this case, the mcm54260 256k 16 dram device is chosen. this allows a full 32-bit-wide dram solution using only two dram devices, with byte writes still supported using the upper and lower casx pins. both the mc68ec040 and the quicc can access the dram array. the ras1 line should be programmed to respond to a 1-mbyte address space. the address multiplexing scheme is the same as that for the dram simm. no parity support is provided in this case. the ras1dd signal is not used in this case since only two devices are supported. after power-on reset, the software must wait the required time before accessing the dram (approximately 100 m s). the required eight read cycles must then be performed either in software or by waiting for the quicc refresh controller to perform these accesses.
applications 9-47 mc68360 user? manual motorola figure 9-15. 4-mbyte dram bank?6 bits wide ma0 ma1 ma2 ma3 ma4 ma5 ma6 ma7 ma8 ma9 ras1 ras1dd cas0 cas1 cas2 cas3 r/w d7?0 prty3 d15?8 prty2 d23?16 prty1 d31?24 prty0 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 ras0 ras2 cas0 cas1 cas2 cas3 w dq7?q0 dq8 dq16?q9 dq17 dq25?q18 dq26 dq34?q27 dq35 a0 a1 a2 a3 b0 b1 b2 b3 y0 y1 y2 y3 oe sel a0 a1 a2 a3 b0 b1 b2 b3 y0 y1 y2 y3 oe sel a0 a1 a2 a3 b0 b1 b2 b3 y0 y1 y2 y3 oe sel amux badd2 badd3 a7 a9 a4 a5 a6 a8 a11 a13 a15 a17 a10 a12 a14 a16 a19 a21 a23 a25 a18 a20 a22 a24 ma0 ma1 ma2 ma3 ma4 ma5 ma6 ma7 ma8 ma9 ma10 ma11 column = a row = b muxed address bus note: ma11?a10 not required but allows future expansion. mc74f157 mc74f157 mc74f157 mcm36100s 1m 36 dram 1m 4 1m 4 1m 4 1m 4 1m 4 1m 4 1m 4 1m 4 1m 4 1m 4 1m 4 1m 4 system bus and quicc-generated signals
applications 9-48 mc68360 user? manual motorola figure 9-16. 1-mbyte dram bank?2 bits wide 9.4.3 software configuration the following paragraphs discuss a number of key points for to a software writer desiring to initialize the system. the points discussed are those that are required to enable the previ- ously mentioned hardware configurations. ma0 ma1 ma2 ma3 ma4 ma5 ma6 ma7 ma8 dq15?q0 ras ucas lcas w a0 a1 a2 a3 b0 b1 b2 b3 y0 y1 y2 y3 sel system bus and quicc-generated signals a0 a1 a2 a3 b0 b1 b2 b3 y0 y1 y2 y3 oe sel a0 a1 a2 a3 b0 b1 b2 b3 y0 y1 y2 y3 sel amux badd2 badd3 a7 a9 a4 a5 a6 a8 a11 a13 a15 a17 a10 a12 a14 a16 a19 a21 a23 a25 a18 a20 a22 a24 ma0 ma1 ma2 ma3 ma4 ma5 ma6 ma7 ma8 ma9 ma10 ma11 column = a row = b muxed address bus mcm54260 256k 16 bit dram a0 a1 a2 a3 a4 a5 a6 a7 a8 d15?0 r/w cas2 bytes 2 & 3 low-order word cas3 ras1 ma0 ma1 ma2 ma3 ma4 ma5 ma6 ma7 ma8 dq15?0 ras ucas lcas w mcm54260 dram a0 a1 a2 a3 a4 a5 a6 a7 a8 d31?16 r/w cas0 bytes 0 & 1 high-order word cas1 ras1 note: ma11?a9 not required but allows future expansion. mc74f157 mc74f157 mc74f157 oe oe 256k 16 bit
applications 9-49 mc68360 user? manual motorola 9.4.3.1 basic initialization. the following paragraphs describe basic software initial- ization. the module base address register (mbar) should be set as desired. however, the quicc 8-kbyte block of address space should not overlap any memory array. the module base address register enable (mbare) should not be accessed. in the module configuration register (mcr), astm and bstm should be set. the user should program bclroid2?clroid0 to $3 and program the sdma, idma1, and idma2 arbitration ids in the sdma configuration register and idma channel configuration registers to 4, 2, and 0, respectively, to allow the sdma and dram refresh to preempt idma trans- fers. shen1?hen0 should be left cleared. supv should be cleared. bclriid2 bclriid0 are not used and can be programmed to $0. iarb3?arb0 can be left pro- grammed to $f to allow sim interrupts to have priority over cpm interrupts that occur at the same level. in the system protection control register (sypcr), dbfe should be cleared. bme should be set. if the software watchdog is not used, the swe bit should be cleared. if the software watchdog is used, the swri bit should be left set to cause a system reset, rather than an interrupt. the periodic interrupt control register (picr) may be set as desired. the port e pin assignment register (pepar) should be set to $31c0, which configures three ioutx lines to go out on some of the irqx pins, the ras1dd pin, and the use of the we lines instead of the a31?28 lines. it also configures the amux pin (assuming dram is used in the system; otherwise, the oe function should be programmed), four casx lines, cs7 , and aveco . 9.4.3.2 configuring the memory controller. the following paragraphs describe configuring the memory controller registers. the global memory register (gmr) should be configured as follows: the rfcnt bits may be set as desired. at 25 mhz, an rfcnt value of 24 (decimal) gives one refresh every 15.6 m s. rfen should be set. rcyc depends on the dram speed. at 25 mhz (an 80-ns dram simm), rcyc should be 00. pgs2?gs0 is not relevant since page mode and internal address multiplexing is not used. dps should be set to 00. wbt40 depends on timing; it is usually cleared for 80-ns dram simms. wbtq depends on timing; it is usually set for 80-ns dram simms. emws is not used in this design since there is only one quicc. it should be cleared.
applications 9-50 mc68360 user? manual motorola sync is not used in this design since there is only one quicc. it should be cleared. opar may be chosen by the user. pbee should be cleared because parity errors should not generate bus errors in mc68040 companion mode. tss40 should be set to meet mc68ec040 electrical specification 11. however, it may be cleared for faster operation if spec 11 is reduced from 30 ns to 25 ns because of a lightly loaded mc68ec040 bus. ncs should normally be set. dwq should be cleared since page mode is not allowed in mc68040 companion mode. dw40 depends on the timing analysis. amux should be cleared. the memory controller status register (mstat) is used for reporting write protect and parity errors and does not require initialization. the eight base registers (brs), one for each memory bank, should be configured as follows: the ba27?a11 bits may be set as desired. different memory arrays should not overlap. ba31?a28 should be cleared since the byte write lines are used with an external master in the system. for simplicity, fc3?c0 can be cleared. trlxq should normally be cleared for memory interfaces. back40 should be set if the quicc provides bursting for the mc68ec040 accesses to standard sram and dram. csnt40 should normally be set. csntq should normally be cleared. paren should be set for memory banks that use parity. wp should be set for eprom, burst eprom, and flash eprom; otherwise, it should be cleared. v should be set if the memory bank is used. the eight option registers (ors), one for each memory bank, should be configured as fol- lows: the tcyc bits should be set to determine the number of wait states required. the am27?m11 bits should be set to determine the block size of the chip select or rasx line. this should be the total number of bytes in each memory array except the eeprom, which should be 32 kbytes rather than 8 kbytes. fcm3?cm0 may be set to all zeros to allow the chip select or rasx line to assert on all function codes except cpu space (interrupt acknowledge). it is advisable to program fcm3?cm0 to zeros, at least during the initial stages of debugging.
applications 9-51 mc68360 user? manual motorola bcyc1?cyc0 may be set to zeros (no wait states) if the quicc is controlling the burst- ing for the mc68ec040 and the timing supports one-clock mc68ec040 bursting. howev- er, with 60- or 70-ns drams at 25 mhz, bcyc1?cyc0 should be set to 01 for two-clock mc68ec040 bursting. pgme should be cleared. sps1?ps0 should be cleared. dssel should be set only if this is a dram bank. 9.4.4 interfacing multiple quiccs to an mc68ec040 it is possible to interface multiple quiccs to an mc68ec040. the first quicc can be con- figured as previously shown in this subsection. additional quiccs should be configured as noted in the following list: the additional quiccs should have their config2?onfig0 pins configured for slave mode, global chip select disabled , and mbar at $003ff04. these quiccs still recognize and respond to mc68040 cycles via the ts pin, even though their config2 config0 pins are not configured for mc68040 companion mode. the mbar of the additional quiccs should be programmed using the mbare pin and mbare register as described in section 6 system integration module (sim60). an external bus arbiter is required to take the bus request of the additional quicc (which is an output because of the config2?onfig0 pins) and prioritize it with the mc68ec040, present it to the original quicc, and issue a bus grant to the appropriate device. an external interrupt prioritizer is required to determine which quicc iout2 ?out0 pins are currently routed to the mc68ec040. alternatively, the additional quicc should have its interrupts brought out on a single rqout pin, which is routed to one of the original quicc interrupt inputs. this would eliminate the external logic. the additional quiccs should not be configured to perform any memory controller sup- port functions for the mc68ec040. only the original quicc should be used for this pur- pose. 9.5 selecting cache modes on the mc68ec040 when the quicc is used in its mc68040 companion mode with the mc68040, it is recom- mended that the quicc serial data buffers be cache inhibited by the mc68040. this avoids the overhead that would result from the cache coherency algorithms of the mc68040 follow- ing the frequent write accesses by the quicc to one of its serial data buffers located in external memory. when using the mc68040, the mc68040 memory management unit (mmu) may be used to cache inhibit the data buffers. however, the lower cost mc68ec040 does not have an mmu. therefore, what technique can be used by the mc68ec040 to cache inhibit serial data buffers? the following paragraphs discuss a method for selecting caching modes on 16-byte boundaries for an mc68ec040. the mc68ec040 delivers high performance at a low system cost for embedded control by providing the same high integer performance and large 4k instruction/data caches as the mc68040 without the floating-point unit and mmu. the mc68040 mmu makes the caching
applications 9-52 mc68360 user? manual motorola mode selectable for each 4k or 8k page within memory. the use of several caching modes within the same address range is made more difficult without the mmu. the access control unit of the mc68ec040 provides two access control registers each for data and instructions. each access control register allows caching modes to be defined in 16-mbyte to 4-gbyte sections. this coarse division of the memory map is not ideal for all embedded applications. the following paragraphs explain an addressing scheme that allows all parts of the memory map to be independently available using any of the mc68ec040 caching modes on line boundaries (a line equals 16 bytes). since any part of the memory map is accessible as cache-inhibited, copyback, or write-through, there is no requirement to split caching modes on 16-mbyte boundaries. furthermore, since the cache mode can be selected down to the line boundary, different areas within the same address region (e.g., dram) are accessible in any or all of the three caching modes. 9.5.1 the algorithm two address bits are used to divide the mc68ec040 4-gbyte addressing range into four 1- gbyte sections. the only difference between the sections is the caching modes. the cach- ing mode of one section is made cache-inhibited, serialized (address bits = 00); the next sec- tion is made cachable, copyback (01); and the last two sections are made cachable, write- through (1x). the address bit ordering (00, 01, 1x) allows the 1-gbyte sections to be nested. address bits 00 are at the bottom of the address map, address bits 01 are in the middle, and address bits 1x occupy the top half of the address map. each 1-gbyte section is mirrored onto every other section to provide a single 1-gbyte addressing range. the address mirror- ing is done by externally ignoring the two address bits used to select the caching mode. the regions are mapped into memory using the remaining 30 address bits. the caching mode of any part of the 1-gbyte address range is now selected by software. if the address bits used for cache mode selection are 00, the access is cache-inhibited. if the address bits are 01, the access is a copyback. if the address bits are 10 or 11, the access is a write-through. the address bits can be any of the top eight address bits (a31?24) and do not need to be contiguous. 9.5.2 protection this cache addressing method does not provide any internal protection from incorrectly accessing an address with the wrong caching scheme. the answer is to rely on the software to correctly access with the correct caching mode or to externally qualify the accesses with the caching mode address bits. special care is required to avoid mixing caching modes within the same memory line. an example of the problem is a cachable and noncachable access to the same line. a copyback access to one long word of a line will cause all four long words of the line to be read into memory. a cache-inhibited access to another long word of the same line would not hit in the cache, but rather hit in the external memory. a cache line push of the copyback line can now overwrite the cache-inhibited long word in external mem- ory. a subsequent memory access to the cache-inhibited long word of the same line will now differ based on whether the cache push of the line has occurred. the solution is to use line boundaries when choosing caching modes. to change the cache mode of a line from cach- able to cache inhibited, do a cpush or cinval of the line when making the change to ensure that the cache does not contain a copy of a cache-inhibited line. to switch from cache inhibited to cachable, the internal caches do not require any change.
applications 9-53 mc68360 user? manual motorola 9.5.3 mc68ec040 cache behavior to better understand the cache operation of the mc68ec040, the following brief explana- tion describes how the mc68ec040 caches and access control unit work. when the mc68ec040 comes out of reset, the caches and access control units are disabled, and all accesses are in cache-inhibited, nonserialized mode. when the caches are first enabled, the information in the cache is unknown; therefore, it is important to invalidate the caches before enabling them. the caches are enabled by accessing the cache access control reg- ister (cacr). the data access control unit is enabled by enabling one or both of the data access control registers (dac0 and dac1). when a data access is made, the mc68ec040 compares the upper eight bits of the address to the base address and address mask of the enabled data access control registers. an address match with the data access control reg- ister occurs if the upper eight bits of the access address matches the base address or is masked off by the data access control register address mask. if the address does not match either data access control register, the caching mode is the default (cache-inhibited, nonse- rialized if the cache is disabled or write-through if the cache is enabled). if the address does match one of the data access control registers, the cache mode bits of the matching data access control register select the caching mode. if both data access control registers match, dac0 takes priority over dac1. the instruction accesses work the same, except the instruc- tion access control unit is used. 9.5.4 enabling the caching modes to enable the multiple caching modes, enable dac0 and iac0 for cache-inhibited, serial- ized (cache mode bits = 10), mask out (set to ones) all but two address bits, and set the remaining two address bits to the cache-inhibited, serialized region (e.g., address bits = 00). enable dac1 and iac1 for cachable, copyback (cache mode bits = 01), mask out (set to ones) all but two address bits, and set the remaining two address bits to the cache-inhibited, copyback region (e.g., address bits = 01). the write protect bit, user page attribute bits, and function code bits are set as the user requires for both dac0 and dac1. when the caches are enabled, all accesses in which the nonmasked address bits are 00 use dac0 or iac0 and are cache-inhibited, serialized. all accesses in which the nonmasked address bits are 01, use dac1 or iac1 and are cachable, copyback. all accesses in which the nonmasked address bits do not match either access control register are not affected by the access con- trol units and default to cachable, write-through. the following mc68ec040 code is used for enabling the access control unit for this caching scheme: move.ld0, ?a7) cinvabc move.l#$80008000,d0 movecd0,cacr move.l#$003fc020,d0 movecd0, dac0 movecd0, iac0 move.l#$403fc010,d0 movecd0, dac1 movecd0, iac1 move.l(a7)+,d0
applications 9-54 mc68360 user? manual motorola note depending on the assembler used, the acronyms dtt and itt may have to be used instead of dac and iac. 9.6 interfacing the quicc to the 53c90 scsi controller in the late 1970's, schugart and associates introduced a parallel bus called schugart asso- ciates system interface (sasi). because of sasi's generic nature and ability to function as a device-independent peripheral or system bus, other manufacturers quickly adopted it. in 1982, ansi standardized an enhanced version of sasi renaming it the small computer sys- tem interface (scsi). since its standardization as a bus and due to its diverse potential, scsi has enjoyed great popularity as an alternative means to network-dissimilar high-per- formance hosts. the following paragraphs give a general description of the scsi bus, including its major sig- nals and functions. the hardware and software interface between the quicc and the 53c90 scsi controller is also discussed. this subsection highlights an example of a quicc idma channel and the memory controller features that allow the quicc to interface to slower peripherals. 9.6.1 scsi general overview scsi is an 8-bit, parallel i/o bus that provides a host computer with the capability of adding different disk drives, tape drives, printers, and even communication devices without major modifications to the system hardware or software. it uses logical rather than physical addressing for all data blocks. a maximum of eight devices can be attached to the scsi bus. of these eight, only one pair of devices can communicate at one time. each scsi device has an id bit assigned to it that is the bit-significant representation of the scsi address referring to one of the signal lines db7?b0. db7 has the highest priority. when two devices communicate over the scsi bus, one acts as an initiator (host), and the other acts as a target (controller). the initiator origi- nates the operation, and the target performs the operation. 9.6.2 physical interface the physical bus interface is composed of a group of characteristics: speed, bus signals, and device count. speed, the ability to transfer data, uses two handshaking protocols: synchronous and asyn- chronous. synchronous transfers a series of bytes before the handshake occurs; whereas, asynchronous requires a handshake for every byte transferred. rates up to 6 mbytes/sec can be accomplished asynchronously; 10 mbytes/sec is possible on the synchronous pro- tocol. scsi devices are daisy-chained using a common cable. this 50-conductor cable is used by the bus signals to interchange data, commands, status, and message information. table 9- 1 and figure 9-17 describe the scsi bus signals.
applications 9-55 mc68360 user? manual motorola figure 9-17. scsi bus signals the scsi bus has a total of 18 signals? are used for control, and 9 are used for data (one parity bit). the bidirectional data lines transfer data, commands, status, and message infor- table 9-1. scsi bus signals signal driven by signal explanation db0?b7 initiator/target 8-bit bidirectional data bus. dbp initiator/target data-bus parity line. optional. atn initiator attention. used to send a message to the target when it controls the bus. bsy initiator/target busy. indicates that the bus is unavailable for use. ack initiator acknowledge. used by the initiator for handshaking. rst any device reset. used to initiate a bus-free phase. msg target driven by the target to indicate that the current transfer is a message. sel initiator select. used by the initiator to select a target before command execution. also used by the target to reconnect when the reselection phase is implemented. c/d target control/data. used during the information transfer phases to transfer commands, sta- tus, data or messages over the bus. req target request. used by the target during information transfer phases. i/o target input/output. determines the direction of the transfer. host processor (quicc) host bus adapter (53c90) disk controller disk data lines msg req i/o c/d bsy rst sel atn ack scsi bus host bus
applications 9-56 mc68360 user? manual motorola mation. the control signals and the bus phases determine when and what direction data is transferred. a description of the phases is given in 9.6.3 logical interface. device count refers to the maximum number of devices on the bus. the scsi bus supports up to eight devices, including the host. it also provides two electrical interfaces, single-ended or differential. the single-ended driver and receiver configuration uses ttl logic levels and is primarily intended for applications within a cabinet where the cable length will not exceed 6 meters (20 feet). differential, on the other hand, uses eia rs-485 signals and can drive cable lengths up to 25 meters (82 feet). figure 9-18 and figure 9-19 show the single-ended and differential configurations.
applications 9-57 mc68360 user? manual motorola figure 9-18. single-ended scsi bus interface dbp db0?b7 a0?3 cs rd wr dreq dack int clk 53c90 vdd sdo0 sdo1 sdo2 sdo3 sdo4 sdo5 sdo6 sdo7 sdop sdi0 sdi1 sdi2 sdi3 sdi4 sdi5 sdi6 sdi7 sdip selo bsyo reqo acko msgo c/do i/oo atno rsto seli bsyi reqi acki msgi c/di i/oi atni rsti igs tgs/diffm reseto +5v vss reset sd0 sd1 sd2 sd3 sd4 sd5 sd6 sd7 sdp sel bsy req ack msg c/d i/o atn rst scsi bus processor interface
applications 9-58 mc68360 user? manual motorola figure 9-19. differential scsi bus interface dbp db0edb7 a0ea3 cs rd wr dreq dack int clk 53c90 vdd sdo0 sdo1 sdo2 sdo3 sdo4 sdo5 sdo6 sdo7 sdop sdi0 sdi1 sdi2 sdi3 sdi4 sdi5 sdi6 sdi7 sdip selo bsyo reqo acko msgo c/do i/oo atno rsto seli bsyi reqi acki msgi c/di i/oi atni rsti igs reseto tgs/diffm +5v vss reset processor reset vdd 220 w notes : 1. differential mode causes the sdox outputs to become active-high scsi data bus buffer enables and the sdix pins to become a bidirectional scsi data bus. 2. differential mode causes the selo, bsyo, and rsto pins to also become active-high buffer enables. observe special use of the reset on the sel, bsy, and rst buffers. reset reset reset reset sele sel+ bsye bsy+ reqe req+ acke ack+ msge msg+ c/de c/d+ i/oe i/o+ atne atn+ rste rst+ 1 k w db0e db0+ db1e db1+ db2e db2+ db3e db3+ db4e db4+ db5e db5+ db6e db6+ db7e db7+ dbpe dbp+ @ 75als176 75als176 processor interface @= 220- w pullup required. legend: @ @ @ @ @ @ @ @
applications 9-59 mc68360 user? manual motorola 9.6.3 logical interface communicating across the scsi bus occurs through a series of phases. the protocol is made up of communication cycles, where each cycle is a sequence of states and the bus can never be in more than one state at a time. the protocol has eight phases, and each phase performs a specific function, such as idling, arbitrating, selecting, reselecting, and sending commands, data, messages, and status. from a hardware perspective, each phase is determined by the scsi bus control lines. figure 9-20, a phase sequence diagram, shows how the phases fit together to form the communication cycle. some phases, such as arbi- tration, reselection, and message out, are optional. they are used when the bus has multiple initiators. the following list describes the different phases: bus-free?he idling state of the scsi bus. when in this state, no scsi device is ac- tively using the bus, and the bus is available for subsequent users. arbitration?sed to determine which device gains control of the scsi bus. arbitra- tion is necessary when two or more devices are simultaneously competing to use the bus. selection?sed to establish a communications link between an initiator and a target device to perform a scsi command. typically, the command is a read or write function to the target. reselection?ptional phase controlled by the target. this phase allows the target to reconnect to an initiator so that an operation that was previously started by the initiator, but suspended by the target, can be finished. information-transfer?ncludes command, data, status, and message phases. they are entered by asserting the bsy line and negating the sel line. the c/d, i/o, and msg signals are used to differentiate between the phases. command?llows the target to receive a command from the initiator in the form of a command-descriptor block (cdb). it is used to tell the target which type of operation to perform (e.g., read/write a sector from a disk). cdbs are usually 6, 10, or 12 bytes in length. data?wo phases: data in and data out (direction is determined by the originator). the data phase is entered when the target negates the c/d and msg lines and asserts (in- put) or negates (output) the i/o line. message?imilar to the data phase because it can be message in or message out. it conveys information on the status of a command and is entered when the target asserts the c/d and msg lines during req and ack handshakes. i/o has the same function as in the data phase. status?sed to send one status byte from the target to the initiator. this phase falls between the data and message phases and consists of sending a good status byte if the data transmitted was received correctly. the status phase is entered when the tar- get asserts the c/d and i/o lines while msg is negated.
applications 9-60 mc68360 user? manual motorola figure 9-20. phase sequences of the scsi bus table 9-1 is a truth table summary of the preceding description (1 = signal asserted and 0 = signal negated). i table 9-2. information transfer phases signal sel bsy msg c/d i/o direction phase 0 1 0 0 0 to target data out 0 1 0 0 1 from target data in 0 1 0 1 0 to target command 0 1 0 1 1 from target status 0 1 1 0 0 reserved 0 1 1 0 1 reserved 0 1 1 1 0 to target message out 0 1 1 1 1 from target message in arbitration (optional) selection reselection (optional) command data status message (optional) bus free
applications 9-61 mc68360 user? manual motorola 9.6.4 functional description the 53c90 scsi controller consists of three major sections: the processor interface, the data path, and the logic block. the processor interface includes the 8-bit data bus, parity bit, chip select, read/write strobes, a0?3 address lines, interrupt request, and dma signals. the data path consists of a 16-byte fifo, parity generation, dma interface, and scsi data and control bus inputs/outputs. the logic block consists of a hierarchy of sequencers that direct the scsi bus control signal timing. the 53c90 has a set of on-chip state machines that directly perform many scsi sequences. the instruction sequencer and master sequencer provide control of these state machines. since the 53c90 has no real decision-making capability, it relies on the cpu32+ for supervisory control and for integrating the performed scsi sequences into complete operations. processor service is requested through a standard interrupt structure, and the 53c90 reports the status through its register set. overall control of the 53c90 is done through the processor interface. the processor data bus and associated control signals provide the means to initialize and set the operating mode of the scsi as well as provide the data path for information swapping. the processor can write to a set of 12 registers, instructing the 53c90 what function to perform, then read another set of registers to determine the status. once the 53c90 starts executing, all data transfers are handled by the dma. since the 53c90 does not have an onboard dma controller, it relies on one of the two independent dma (idma) channels of the quicc. in this case, idma1 is arbitrarily chosen. idma1 of the quicc moves the data to and from the 53c90 fifo. the fifo provides a 9-bit-wide by 16- byte-deep buffer. it can be accessed by either the idma or the processor at register address $02 and can be read or written as a register. the bottom of the fifo is read and unloaded while the top is written to and loaded. therefore, for an scsi transfer to occur, the processor has to initialize the 53c90 by writing to its registers, initialize idma1 by setting up its registers, and then monitor the status of the 53c90. table 9-2 lists the read and write registers in the 53c90. table 9-3. 53c90 read and write registers address (hex) read register write register $00 transfer counter lsb transfer counter lsb $01 transfer counter msb transfer counter msb $02 fifo fifo $03 instruction executing instruction holding $04 status destination id $05 interrupt select/reselect timeout $06 sequence step synchronous period $07 fifo flags/seq. step synchronous offset $08 configuration 1 configuration 1 $09 reserved clock conversion (presel) $0a reserved test mode $0b configuration 2 configuration 2 $0c-$0f reserved reserved
applications 9-62 mc68360 user? manual motorola 9.6.5 hardware configuration the following paragraphs describe the hardware configuration of the scsi controller inter- face. figure 9-21 shows the scsi bus interface. 9.6.5.1 clocking strategy. in this application, the system clock is generated from a 32.768-khz crystal into the quicc. the quicc internal pll multiplies the frequency up to 25 mhz and outputs 25 mhz on clko1, which is fed into the 53c90 clk input. clko2, which has 50 mhz available, might be disabled in software to save power. it is also possible to run the quicc at 20 mhz and feed the 53c90 40 mhz from clko2 to achieve fast scsi synchronous mode. in that mode, make sure the prescale bit in the clock conversion register ($09) of the 53c90 is set. timing issues also need to be considered. the use of the 32.768-khz crystal is not a requirement but is a low-cost solution. a 25-mhz external oscillator can also be used. the quicc clocking section allows for the clock oscil- lator to be kept running through the vddsyn pin in a power-down situation, if desired. 9.6.5.2 reset strategy. if a pushbutton switch is needed, it can be connected by an open-drain buffer to the quicc reseth line, once debounced. the quicc reset control logic asserts reseth for a minimum of 512 cycles (20.48 m s at 25 mhz); this is inverted and routed to the 53c90 reset input since it is an active-high reset. 9.6.5.3 read/write timing. the cpu32+ is running three clock cycles on a normal zero-wait-state bus cycle, implying 120 ns for the read or write bus cycle (f = 25 mhz, clock period is 40 ns). looking at the quicc read timing, the read strobe (oe ) is asserted after the falling edge of s0. electrical specification 9 can be as long as 20 ns. from the time the read strobe is asserted until data is valid from the 53c90 can be as long as 70 ns, giving a total time of 90 ns, which would occur after the falling edge of s4 where the data should be read. therefore, one wait state should be inserted on the read cycle. cycle time is also important. the 53c90 needs a minimum of 40 ns before the next read; whereas, the quicc guarantees a minimum of 30 ns. trlxq and csntq bits in the base register of the quicc chip select should be set to ones to relax the timing and allow successive reads. using we0 as the strobe for the write cycle, the cpu32+ will guarantee a minimum hold time of 35 ns; the 53c90 needs 2 ns. the setup time is a 35-ns minimum for the quicc; the 53c90 needs 11 ns. therefore, no wait states are needed for the write cycle, but cycle time is an issue. the 53c90 needs a minimum of 60 ns before the next write; whereas, the cpu32+ guarantees 35 ns. again, set the trlxq and csntq bits to one to relax the timing and allow successive writes 9.6.5.4 interrupt handling. there are multiple scsi instructions that would generate an interrupt to the quicc. since the 53c90 does not put a vector on the bus, it will use avec to terminate the bus cycle and generate an automatic vector number. this interrupt is coming in at irq2 , leading to a vector number of 24 + 2 = 26 ($1a). the autovector reg- ister should be initialized to handle an autovector on irq2 . when the quicc is interrupted, the interrupt service routine should read the status register and sequence step register of the 53c90 before reading the interrupt register. reading the interrupt register resets the interrupt pin (int ), the contents of the sequence step register, bits 7? of the status register, and the contents of the interrupt register itself.
applications 9-63 mc68360 user? manual motorola figure 9-21. quicc to scsi bus interface dbp db0?b7 a0?3 cs rd dreq dack clk wr int 53c90 mc68360 prty0 d24?31 a0?3 d0?23 a4?27 cs7 oe r/w dreq1 dack1 cs6 clko1 we0 irq2 ds as we3?e0 cs0 ras1 cas3?as0 amux badd3?add2 prty3?rty1 cs3 cs4 cs5 port a port b port c config2 config1 config0 reseth halt +5v 10k tms tdi tdo tck trst bkpt tris ipipe1?pip0 irq7 irq5?rq0 vddsyn xfc +5v 400pf 0.1 f 0.01 f to vddsyn modck0 modck1 xtal extal +5v 4.7k to dram (simm or devices) to eprom (regular, or flash) @ = pullups required (<= 10k) & = pullups recommended (<= 10k) system bus to sram (optional) vdd sdi0 sdi1 sdi2 sdi3 sdi4 sdi5 sdi6 sdi7 seli bsyi reqi acki msgi cdi ioi atni rsti sdo0 sdo1 sdo2 sdo3 sdo4 sdo5 sdo6 sdo7 sdop selo bsyo reqo acko msgo cdo ioo atno rsto igs tgs/diffm reseto +5v vss +5v 10k +5v 10k +5v 10k reset +5v scsi bus single-ended or d ifferential modes (fig. 18 & 19) resets +5v 4.7k m m legend: atni atni atni atni sdip sdip sdip sdip sdi3 sdi3 sdi3 & & @ & +5v 4.7k +5v 4.7k 25mhz crystal oscillator
applications 9-64 mc68360 user? manual motorola after determining what caused the interrupt, the service routine would branch to the appro- priate portion of the program to execute. irq2 was chosen to cause the 53c90 interrupts to have a lower priority than interrupts from other high-speed serial activity. the priority can be moved up if the system requires it. 9.6.5.5 idma1 setup and timing. after the processor initializes the 53c90 and all its registers, idma1 will take care of all the data movement to and from memory. the 53c90 has a dma interface, and special care should be taken in the hardware connections. chip select and dack cannot be asserted at the same time on the 53c90. when idma1 is requested, it will put out the address of the 53c90 and assert the chip select. to overcome this, another chip select is used with a different address range. the 53c90 needs the mini- mum memory range available (2k block). assuming all peripherals are at address $04000000 and the 53c90 is at address $04001000, then cs7 will decode $04001000 on the read/write cycles, and cs6 will decode $04001800 on the dma cycles. this way the 53c90 will take a 4k address block. cs6 is used because it will provide dsack1 to termi- nate the dma cycles. the 53c90 requires dack to be cycled once for each dma access. this is available on the quicc for both single and dual address transfers. in this case, however, packing of data from the 8-bit scsi port to a 32-bit memory is desired; therefore, dual address transfers must be used. thus, the scsi will be accessed four times followed by a 32-bit access to memory. the maximum transfer rate in this case is 7.1 mbyte/sec: (4 byte 25 mclocks/sec) / ((4 3) + 2 clocks per transfer) = 7.1 mbyte/sec accesses to the 53c90 are three clocks; whereas, memory may be accessed as fast as two clocks. idma1 has eight registers that define its specific operation: 32-bit source address pointer register (sapr) 32-bit destination address pointer register (dapr) 16-bit channel configuration register (iccr) 8-bit channel mask register (cmar) 8-bit function code register (fcr) 32-bit byte count register (bcr) 8-bit channel status register (csr) 32-bit channel mode register (cmr) these registers provide the addresses, transfer count, and configuration information neces- sary to set up a transfer. they also provide a means of controlling the idma channel and monitoring its status. all registers can be modified by the cpu32+ core. the data holding register is another 32-bit register in the idma, but it is not accessible by the cpu32+ core. it is used for temporary data storage. every idma operation involves the following steps: channel initialization, data transfer and block termination. in the initialization phase, the cpu32+ loads the registers with control information, then starts the channel. in the transfer phase, the idma accepts requests for operand transfers and provides addressing and bus control for the transfers. the termina- tion phase occurs when the transfer is complete and the idma interrupts the cpu32+.
applications 9-65 mc68360 user? manual motorola 9.6.5.6 quicc i/o ports. the functions on quicc parallel i/o ports a, b, and c may be used as desired in this application. however, any unused parallel i/o pins should be config- ured as outputs so they are not left floating. do not forget to enable the dreq1 and dack1 pins on port b. 9.6.6 active scsi terminations there are multiple devices that provide switchable precision scsi bus terminations. they are available in surface mount packages for different bus sizes. by utilizing flexible system design techniques, enabling or disabling terminations can be accomplished in software or hardware. motorola's family of scsi terminators currently includes the following devices: mccs142233 (passive, 9 resistor pairs, 220 w /330 w ) mccs142234 (active, 9 bits, 110 w ) mccs142235/36/37 (active, 18 bits, 110 w , different voltages, regulators, and enables) mc34268 (scsi-2 active terminator). for more information, refer to the individual data sheets on each part. 9.6.7 software configuration the following paragraphs discuss a number of key points for a software engineer desiring to initialize the system. the only items discussed are those that are required to enable the previously discussed hardware configuration. see 9.1 minimum system configuration for additional information. 9.6.7.1 configuring idma1. in this example, it is assumed that data is transferred from the 53c90 to 32-bit-wide memory. therefore, the source size is one byte and the destination size is long word. the source address should be outside the 53c90 memory space but should still access the fifo at $02 ($04001802), and the destination address should be $a0000000. the number of bytes to be transferred is 4 mbytes. iccr = $0720. the idma ignores the freeze signal, idma1 has priority over idma2 and all interrupt handlers, idma1 arbitration id is 2 while idma2 is 0, and the system clock operates normally within the idma. fcr1 = $89. source function code is 1000; destination function code is 1001. sapr1 = $04001802. source address. dapr1 = $a0000000. destination address. bcr1 = $00400000. byte transfer count. csr1 = $ff. clear any csr bits that are set. cmar1 = $ff. enable all interrupts. cmr1 = $8941. the 53c90 uses the control signals during the read portion of the trans- fer. the idma1 uses asynchronous request mode, dual address transfer, single buffer mode, and external request burst transfer mode. the sapr and dapr are incremented according to source size (byte) and destination size (long word). setting str starts the channel.
applications 9-66 mc68360 user? manual motorola 9.6.7.2 configuring the memory controller. the following paragraphs describe configuring the memory controller. for information on configuring the global memory register (gmr), refer to 9.1 minimum sys- tem configuration. the memory controller status register (mstat) is used for reporting parity errors and does not require initialization. eight base registers (brs) exist, one for each memory bank. br6 and br7 for cs6 and cs7 will be specified with the 53c90 address being $04001000. please refer to 9.1 minimum system configuration for dram and other memory configurations. br7 = $0400104d. address decoded is $04001xxx, function codes are xxxx (don't care, will be masked in or7), trlxq and csntq are set, parity is enabled, read and write ac- cesses are allowed, and this base register is valid. br6 = $04001805. same as br7, except trlxq and csntq are not set and the next consecutive 2k memory block is selected. eight option registers (ors) exist, one for each memory bank. the following information is valid for registers or6 and or7: dssel should be 0. sps1?ps0 should be 10 (indicating port size is 8 bits). pgme should be 0 since this is not dram. bcyc1?cyc0 are not used and should be cleared. fcm3?cm0 may be cleared to zeros to allow the chip select or ras line to assert on all function codes, except cpu space (interrupt acknowledge). it is advisable to program fcm3?cm0 to zeros, at least during the initial stages of debugging. the am27?m11 bits will mask the address if they are cleared. in this application, they are all set to allow decoding. the tcyc bits should be set to determine the number of wait states required?ne wait state on cs7 (0010) and no wait states on cs6 (0001). therefore, or7 = $2ffff804 and or6 = $1ffff804. 9.7 using the quicc as a tap controller for board self-test an assembled board is often tested with complex test equipment using a unique test port or a bed-of-nails fixture. this procedure becomes more difficult as device packages and fea- tures become smaller. the objective of the jtag standard is to define a boundary scan architecture that can be adopted as a part of an integrated circuit to perform both an in-circuit test and a verification of the interconnection between different devices. the jtag standard defines test logic that can be integrated into a device to perform: 1. testing of the interconnection between devices once they have been mounted on a printed circuit board or any other substrate.
applications 9-67 mc68360 user? manual motorola 2. testing of the device itself. 3. observation or modification of the activity on the board. the test logic is comprised of features that include the boundary scan register and is accessed through the test access port (tap). 9.7.1 board layout the test equipment interfaces to the board through a test bus, with the tester acting as a test bus master. this bus is comprised of the boundary scan signals and consists of one or sev- eral parallel signal paths. although different architectures are described in the jtag stan- dard document, this application shows only one serial connection. as shown in figure 9-22, one data signal loop is created with relevant device. the test data in (tdi) signal enters the device and exits the device as test data out (tdo) at the other end of the shift register. in addition, a clock signal (tck) and a mode signal (tms) are distributed to all devices in par- allel. an example of a board designed with the boundary scan path architecture is shown in figure 9-22. most devices, like device 2 through device 5, are included in the loop. other devices such as memories can be tested directly from a microprocessor. usually, the board will also contain small logic functions or analog ics that do not contain boundary scan logic. once the board is tested with the test equipment, it is typically stored until it is installed in the final system. this storage time is comprised of warehouse and shipping time. how then can the board be retested before it begins to interact with a larger system in the end appli- cation? this is of particular importance in telecommunication systems with distributed intel- ligence, since an error can propagate throughout the entire system if one node is malfunctioning. today, almost every board design includes some kind of processor or controller. this con- troller can be used as the test bus master to perform a board test using an existing boundary scan path. the following paragraphs describe how this concept can be achieved using the quicc as the board controller.
applications 9-68 mc68360 user? manual motorola figure 9-22. jtag scan path 9.7.2 board testing the patterns used for factory testing can be modified for self-testing of an installed board. the self-test can be used to check direct interconnections as well as board functions. the testing of memories on the board can be accomplished under direct program control of the quicc; however, the boundary scan vectors under control of the onboard controller could be used to test other parts of the board. tap tap tap tap tdi tdo tdo tdi tdi tms tcl tdo tdi tdo tdi tdo board test connector device 1 device 2 device 3 device 6 device 4 device 5
applications 9-69 mc68360 user? manual motorola figure 9-23 shows an enlarged version of a device shown in figure 9-22. the tap is the interface between the external bus and all internal boundary scan logic. the interface is comprised of four mandatory signals, tdi, tdo, tck, tms, and the optional test reset (trst). the tap controller is a sequential state machine. the jtag standard defines operations that must be performed, others that should be performed, and operations that are optional and may vary between different devices and vendors. the tap state machine is stepped by different combinations of the tms and tck signals. data is shifted in through the tdi pin to the instruction register, bypass register, or boundary scan register, depending on the state machine action. the state machine also controls what internal signal path is routed to the tdo pin. although the tap details are application-specific, the discussion of how to access the tap controllers using the quicc is common to all boards. this access is described in more detail.
applications 9-70 mc68360 user? manual motorola figure 9-23. tap controller and registers 9.7.3 microcontroller interface figure 9-24 and figure 9-25 show two ways of routing the signals on a board. figure 9-24 shows the quicc tap port being used in the board test, as well as the ability for the quicc to become the test bus master using its i/o pins. figure 9-25 shows the quicc used simply as a test bus master. tdi tdo tms tck boundary scan register consisting of all i/o ports +5v shift pulses for boundary scan register i/o +5v i/o i/o i/o i/o i/o i/o i/o mux mux bypass register (1 bit) decoder 3-bit instruction register tap controller internal logic
applications 9-71 mc68360 user? manual motorola to control the signal flow, one i/o pin is dedicated as test master mode (mm) control. the latch is used to allow the master mode test bus signals to become i/o in the normal board application, if required. otherwise, the latch may be removed. the arrows indicate the signal flow direction for tdi and tdo. in each figure, tdi is the input data signal from the external tester, and mtdi is the input data generated by the quicc. figure 9-24. signal routing with tap port used in board test b a mux en out en latch board connector i/o functions if not in test master mode to first device in scan loop from last device in scan loop mux: if mm = 1 then a if mm = 0 then b a b mux en out a b mux en out 1 1 a b mux en out a b mux en out tms tck tdi tdo tdi tdo mm mtdo mtdi mtck mtms tck tms quicc with tap in use
applications 9-72 mc68360 user? manual motorola figure 9-25. signal routing for test bus master 9.7.4 test pattern generation the easiest way to generate the test pattern is to use the quicc cpu32+ to transfer the test pattern over its i/o pins using a bit-banging technique. the test pattern output data is written to the i/o ports, and therefore to the pins, by writing to the digital output ports (mtck, mtms, and mtdi); the result is read back by simply read- ing the mtdo pin. a data area is created in memory to hold the test pattern. the cpu32+ compares the result on the mtdo pin to the respective expected result in memory. figure 9-26 shows an example of the pattern that would be stored in the memory array. the three leftmost columns are output signals written to the i/o port, and the right column is the result expected to be read back. since the clock signal is part of the pattern and not sepa- rately generated, both clock phases are represented, and thus two entries comprise each tck clock cycle. mtdi mtms mtck mtdo mm tdi tms tck tdo a b mux out a b mux en out a b mux en out en latch board connector mux: if mm = 1 then b if mm = 0 then a to first device in scan loop i/o functions if not in test master mode en from last device in scan loop quicc without tap in use
applications 9-73 mc68360 user? manual motorola figure 9-26. bit banging of boundary scan pattern the bit-banging pattern is created by writing and reading the array rows to the port as fast as the cpu allows. the instructions to implement the shaded part of figure 9-26 (indicated by "repeat") are listed below. they are needed to perform one test clock cycle along with the data signals. assuming the output array address is located in address register a0, the input array address is in address register a2, with the i/o port located at address a1 and the length of the pattern in d0, one repeat cycle is as follows: tck v v tdi tms tdo 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 t c k 0 1 0 1 0 1 0 1 0 1 t d o 0 0 1 1 1 1 0 0 1 1 row nr 1 2 3 4 5 6 stable input output valid write row nr 1 write row nr 2 write row nr 3 read row nr 3 write row nr 4 write row nr 5 read row nr 5 write row nr 6 write row nr 7 read row nr 7 write row nr 8 write row nr 9 read row nr 9 write row nr 10 notes: 1. tck rise and fall time 2. tms, tdi data hold time 3. tms, tdi data setup time 4. tck to tdo valid 5. tck cycle time 6. tck pulse width repeat tck tdi tms tdo t d i t m s 7 8 9 10 1 2 3 6 6 5 4 ih il
applications 9-74 mc68360 user? manual motorola loopmove.b(a0)+, (a1)write row 8 move.b(a0)+,(a1)write row 9 move.b(a1),(a2)+read row 9 (next, compare tdo read value to tdo of pattern and take desired action if the results do not match) dbcc d0,loop the loop is repeated as long as the test condition is false and the counter d0 is more than ?. the test condition can be set to always produce a false prior to entering the loop since the move instructions do not set any flags. assuming a 40-ns clock, this code loop has approximately a 500-khz test clock frequency. the state machine is static, and all logic can be clocked between dc and the maximum device frequency. additionally, there are no constraints on the clock duty cycle. all inputs are sampled on the rising clock edge. data must be valid during a setup time before the transition and a hold time after transition. different input pins have different requirements, depending on whether they belong to the tap or are normal i/o pins. output pins change state on the falling clock edge and can be either high, low, or three-state. the exact i/o pin timings can be found in the ac timing specifications of this manual. the repeat pattern in figure 9-26 is created to meet these requirements. in row 8, the data write pattern is stable, and only the tck pin changes state from 0 to 1. the data write pattern in row 9 sets up the data pattern for the next 0 to 1 clock transition and changes the current clock state back to 0, thus enabling the tdo signal out of the external device. the data read pattern in row 9 reads the tdo into the microprocessor memory array, where it can be com- pared against the expected value. 9.8 interfacing an mc68ec030 master to the quicc in slave mode the following paragraphs describe the interface to the quicc using an mc68ec030 to replace the cpu32+ core on the quicc. when the cpu32+ core on the quicc is disabled, the quicc is in slave mode. in slave mode, another external processor may be used instead of the on-chip cpu32+ core. the quicc, however, has special features for provid- ing a glueless interface to an external mc68ec030 (as well as other m68030 and m68040 family members). the following paragraphs discuss both the hardware and software issues concerning this solution in a system that contains one mc68ec030 and one quicc. it is also possible to interface more than one quicc to an mc68ec030. 9.8.1 mc68ec030 to quicc interface the following paragraphs discuss the hardware and software issues relating to the connec- tion between the mc68ec030 and the quicc. the features of the quicc that may be used to assist the mc68ec030 are also detailed. reference figure 9-27 during this discussion.
applications 9-75 mc68360 user? manual motorola 9.8.1.1 mc68ec030 reads and writes to quicc. the basic connection is made through the data and address bus. all 32 data lines are routed between devices, which is required for the connection. in slave mode, the quicc is not allowed to use its 16-bit data bus mode.(assertion of 16bm pin during reset) twenty-eight address lines are routed between devices, giving a 256-mbyte shared address capability. it is possible to share all 32 address lines between devices, but the quicc would then lose its write enable lines (we3 ?e0 ). since these lines are very useful in memory interfaces, they are used in this application. when running in normal slave mode with an mc68ec030 master, the quicc provides a few signal changes to support the mc68ec030. these signal changes allow the quicc to monitor and control the system buses in a glueless manner. the changed bus signals are bus request (br ), bus grant (bg ), and bus grant acknowledge (bgack ). when operating in normal slave mode, the direction of these signals is reversed. therefore, br is an output; bg is an input. in addition, bgack becomes an i/o signal, rather than just an input. 9.8.1.2 clocking strategy. in this application, a single 25-mhz external oscillator is used to drive the quicc and the mc68ec030, which allows the synchronous mode of the quicc memory controller to be used. when considering buffering of outputs and board lay- out, designers need to consider the synchronous timing requirements of the quicc. designers considering the possibility of running asynchronously or with faster mc68ec030 clock speeds should reference paragraph 9.8.5 using a higher speed mc68ec030 master with the quicc.
applications 9-76 mc68360 user? manual motorola figure 9-27. mc68ec030 to quicc interface d31?0 a27?0 a31?28 dsack1 berr dsack0 r/w siz1?iz0 fc2?c0 ipl2?pl0 avec br bg bgack as ds dben rmc ecs ocs ipend refill status cdis sterm ciin ciout cbreq cback clk as ds we3?e0 cs0 ras1 cs3?s4 cas3?as0 amux badd3?add2 perr irq1,irq4?rq6 cs2,cs5?s6 config2 config1 config0 reseth vddsyn xfc extalcl ko1 clko2 mc68360 d31?0 a27?0 tris dsack1 berr dsack0 r/w siz1?iz0 fc2?c0 iout2?out0 aveco br bg bgack irq2 irq3 port a port b port c halt bclri bkpto irq7 tms tdi tdo tck trst modck0 modck1 xtal mc6ec030 reset halt system bus +5v 10k +5v 10k +5v +5v 400pf 0.1 f 0.01 f to vddsyn 25 mhz osc 10k +5v 10k +5v 4.7k resets +5v 4.7k 10k unused outputs ok to float tie high if unused leave unconnected if unused +5v unused outputs ok to float unused ok to float unused outputs ok to float tie high to disable unused outputs ok to float tie high bursting not available @ = pullups recomended (<= 10k) let float also ras1dd @ @ @ @ @ @ @ note: m m +5v 4.7k +5v 4.7k dq cp s r vcc iack7+reseth+resets cs7 @ @
applications 9-77 mc68360 user? manual motorola it is important for the designer to distinguish the difference between an mc68ec030 access- ing memory synchronously and the quicc memory controller operating in synchronous mode. the mc68ec030 has the ability to access memory in standard asynchronous bus cycles (i.e., three clocks or longer) and synchronous bus cycles (two clocks). for mc68ec030 asynchronous accesses, the quicc memory controller can generate chip selects, dsackx , etc. however, the quicc does not support mc68ec030 synchronous bus cycles (nor does it support mc68ec030 bursting). this does not mean that the mc68ec030 cannot perform two-clock accesses in a quicc system?nly that the quicc will not assist (i.e., generate chip selects, etc.) during these accesses. the quicc memory controller can operate asynchronously or synchronously (defined by the bstm bit in the mcr and the sync bit in the gmr). when the quicc memory control- ler is operating synchronously, the external signals being monitored are not synchronized internally by the quicc, and must be provided with the proper setup and hold times. when the synchronous function is not enabled, externally generated bus signals are latched on the negative edge of the quicc clock before being recognized, permitting external signals to be completely asynchronous to the quicc clock. the quicc memory controller is normally used in synchronous mode with the mc68ec030, even if the mc68ec030 is generating only asynchronous bus cycles. the quicc clocking section allows for the clock oscillator to be kept running through the vddsyn pin in a power-down situation, if desired. low-power issues are not addressed. 9.8.1.3 reset strategy. if a quicc is configured to provide the global chip select, it will also provide an internal power-on reset generation. thus, the reseth pin of the quicc just needs to be connected to the reset pin on the mc68ec030. if a pushbutton switch is needed, it can be connected by an open-drain buffer to the reset line, once debounced. 9.8.1.4 interrupts. external interrupts may be brought into the quicc through either the irqx pins or parallel i/o pins. the quicc prioritizes these interrupts with its own inter- nally generated interrupts (e.g., timers) to obtain the current highest pending request. in slave mode, the quicc can output this request to another processor in the system. the request can take the form of a single request pin or three request pins (iout2 ?out0 ) that encode the priority of the request. since the mc68ec030 uses encoded inputs (ipl2 ipl0 ), the iout2 ?out0 pins are chosen. in addition, the quicc allows the iout2 ?out0 pins to be generated in two different ways: at the expense of parity pins or at the expense of some interrupt requests. in this application, parity is not used in the system; thus, the parity pins are chosen for this function, leaving more interrupt pins available. once the mc68ec030 recognizes the interrupt, it responds with an interrupt acknowledge cycle. the quicc recognizes the mc68ec030 interrupt acknowledge cycle using the address and function code pins (fc3?c0). the quicc then responds by placing the vec- tor on the bus or by outputting the aveco signal to the mc68ec030, depending on what was programmed into the autovector register in the sim60.
applications 9-78 mc68360 user? manual motorola when the quicc is in slave mode, what is normally the avec pin (an input) becomes the aveco pin (an output) for use with external processors. 9.8.1.5 bus arbitration. when the quicc is operating in slave mode with an mc68ec030 master, the quicc bus arbitration pins match those of the mc68ec030. note if an mc68040 were the master, there is a special companion mode on the quicc which would configure the quicc bus ar- bitration pins to match those of the mc68040. the quicc br is an output to the mc68ec030, and the quicc bg is an input from the mc68ec030. in slave mode, the quicc does not support the read-modify-write cycle (rmc ). if support of read-modify-write is necessary, it would be necessary for the designer to implement the functionality in external logic. the br output from the quicc is sent directly to the mc68ec030 in this system. if other bus masters were present, external hardware could determine their relative bus priority. the bclro function of the quicc is not used in this design because the br pin is an output; therefore, bclro is not needed. the quicc also has a bus clear in (bclri ) signal that allows internal masters to be cleared off the bus. this pin can be used with the mc68ec030 ipend pin to give the mc68ec030 interrupts priority over the quicc internal masters. this function is not implemented in the design for the sake of using the alternate function of the pin, the ras1dd function. how- ever, if it were implemented, the ipend signal from the mc68ec030 would have to be latched and kept low by the mc68ec030 until completion of the interrupt routine. (if it was not latched, the quicc would take the bus back from the mc68ec030 as soon as the inter- rupt acknowledge cycle was complete, which defeats the purpose of connecting the ipend pin to the bclri pin.) 9.8.1.6 breakpoint generation. in slave mode, the quicc can be used to generate a breakpoint signal using its breakpoint address register. this register will respond to quicc external master accesses. the result of a breakpoint is the assertion of the bkpto pin on the quicc. in this applica- tion, it was decided to route this output back to an interrupt input on the quicc and generate a nonmaskable interrupt to the mc68ec030. 9.8.1.7 bus monitor function. in slave mode, the quicc will monitor the bus for bus cycles that are not properly terminated. the cycles can originate from the quicc or the mc68ec030. if the mc68ec030 originates such a cycle and that cycle times out without an as , dsackx , berr , or halt occurring, the quicc will assert berr back to the mc68ec030 to end the cycle. 9.8.1.8 spurious interrupt monitor. in slave mode, the quicc will watch for spu- rious interrupt cycles generated by the mc68ec030, but only on the interrupt levels that the
applications 9-79 mc68360 user? manual motorola quicc supports internally (e.g., the level of the sim60 and the level of the cpm). if such a condition occurs, berr will be asserted by the quicc. 9.8.1.9 software watchdog. if desired, the mc68ec030 can program the quicc software watchdog to generate a level 7 interrupt or a system reset. in this application, the software watchdog is configured in software to generate a reset so that the breakpoint logic can use level 7 interrupts. no additional hardware is required because the connection between the reset pins of the quicc and the mc68ec030 is already made. 9.8.1.10 periodic interval timer. if desired, the mc68ec030 can use the periodic interval timer on the quicc to generate a system interrupt, such as for a real-time kernel. no additional hardware is required for this function. 9.8.1.11 mc68ec030 caching configuration. the mc68ec030 can cache or not cache data and program memory as desired. however, it is strongly advisable not to cache the data that is accessed by the quicc serial channels because of the overhead incurred every time the cached data area is written. 9.8.1.12 double bus fault. in slave mode, the quicc double bus fault monitor is not operational. 9.8.1.13 jtag and three-state. the quicc provides jtag ports, commonly known as jtag. this interface uses five pins: tms, tdi, tdo, tck, and trst . tms and tdi are left unconnected because they have internal pullups. the jtag ports of both parts are dis- abled in this application; however, the capability could be easily added. when the quicc is in master mode, it provides a tris pin that allows all outputs on the device to be three-stated. in slave mode, this feature is not available since the quicc is a peripheral of the system. 9.8.1.14 quicc serial ports. the functions on quicc parallel i/o ports a, b, and c may be used as desired in this application and have no bearing on the mc68ec030 inter- face. however, any unused parallel i/o pins should be configured as outputs, so they are not left floating. 9.8.2 memory interfaces in this application, a number of memory arrays have been developed for eprom, flash eprom, eeprom, sram, and dram. each memory interface can be attached to the sys- tem bus as desired. one issue not discussed is the decision of whether external buffers are needed on the sys- tem bus. this issue depends on the number of memory arrays used in the design and pos- sibly the layout (i.e., capacitance) of the system bus. another issue left to the user is the number of wait states used with each memory system. this depends on the memory speed, whether external buffers are used, and the loading on the system bus pins. (the quicc provides capacitance de-rating figures to calculate the effect of more or less capacitance on the ac timing specifications.)
applications 9-80 mc68360 user? manual motorola 9.8.2.1 quicc memory interface pins. in this design, a number of quicc pins are available to the memory arrays (see figure 9-27). these pins are active, regardless of whether the bus cycle was originated by the mc68ec030 or by one of the quicc dma cycles. the quicc detects the mc68ec030 bus cycle by the as pin. if the quicc gener- ates the bus cycle, the quicc asserts the as pin. eight csx or rasx pins are available in the system. in this design, cs0 is used for any of the eprom arrays since this is the global (boot) chip select. ras1 is used for the dram arrays because of its double-drive capability. cs2 /ras2 is not used in the design and is available for other purposes, such as a second dram bank. cs3 is for sram arrays; cs4 is for eeprom. cs5 , cs6, and cs7 are unused. in this design, it is assumed that the full 32-bit capability of the mc68ec030 is used; thus, all memory arrays are 32 bits wide. (the only exception to this is the eeprom, which is han- dled differently. see 9.8.2.4 eeprom . ) this application note does not use the parity support provided by the quicc. therefore, the prty3?rty0 lines are available for their alternate functions. parity support is available only if the sync bit in the gmr is set. the quicc does not internally support mc68ec030 external master bursting. if the user wishes to implement bursting on a particular memory array, the bursting support must be generated externally. the dram arrays require the four cas3 ?as0 pins. also, since an external address mul- tiplexer is used, the amux pin is required to select between rows and columns. if, however, the user's configuration does not require dram, the amux pin can be used as an oe pin instead. this would save an inverter in a number of memory arrays, making the memory interface completely glueless. note many memory arrays show an inverter on the r/w pin to create the oe signal. when using multiple memory arrays, it is possible to share one inverter between multiple memory arrays; however, this configuration is not shown. the quicc also provides four write enable (wex ) pins to select the correct byte during write operations. 9.8.2.2 regular eprom or flash eprom. figure 9-28 shows the glueless interface to standard boot eprom in the system. the assumption is made that only the mc68ec030 will access this array. the mc68ec030 offers dynamic bus sizing on-chip; thus, only an 8- bit eprom is required. the config2?onfig0 pins on the quicc can be pulled low through resistors to select slave mode with an 8-bit port size for the global chip select. the quicc will support dsackx generation to the mc68030 according to an 8-bit port size.
applications 9-81 mc68360 user? manual motorola figure 9-28. 128-kbyte eprom bank? bits wide figure 9-29 shows the interface to flash eprom devices. in this design, the assumption is made that only the mc68ec030 will access this array. the inverter is only required if dram is used elsewhere in the system. this design assumes that the write operations are ce con- trolled, rather than we controlled. most flash eprom manufacturers now support this alter- native timing method. note the quicc config2?onfig0 pins are shown selecting slave mode and a 32-bit port size for cs0 . thus, the config2 config0 pins as shown are appropriate for the flash eprom, not the regular eprom. dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 p ce (enable) oe byte port size d31ed24 a16ea0 cs0 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 +5v system bus and quicc-generated signals 27c010 128k 8 eprom
applications 9-82 mc68360 user? manual motorola figure 9-29. f1-mbyte flash eprom bank?2 bits wide 9.8.2.3 regular sram. figure 9-30 shows the interface to sram. in this design, both the mc68ec030 and the quicc may access the sram array. the inverter is only required we (write) dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 vpp ce (enable) oe byte 2 middle-low byte byte 1 middle-high byte byte 0 high-order byte d31?24 we (write) dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 vpp ce (enable) oe a19?2 d15?8 we (write) dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 vpp ce (enable) oe a19?2 d23?16 we (write) dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 vpp ce (enable) oe byte 3 low-order byte a19?2 d7?0 a19?2 cs0 r/w oe we3 we2 we1 we0 oe oe oe cs0 cs0 cs0 +12v +12v +12v +12v a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 system bus and quicc-generated signals 27f020 256k x 8 flash eprom 27f020 256k x 8 flash eprom 27f020 256k x 8 flash eprom 27f020 256k x 8 flash eprom
applications 9-83 mc68360 user? manual motorola if dram is used elsewhere in the system. the quicc does not support bursting by the mc68ec030. figure 9-30. 128-kbyte static ram bank?2 bits wide 20 w (write) 22 27 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 e (enable) g (oe) 11 12 13 15 16 17 18 19 10 9 8 7 6 5 4 3 25 24 21 23 2 26 1 byte 2 middle-low byte d31ed24 20 w (write) 22 27 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 e (enable) g (oe) 11 12 13 15 16 17 18 19 10 9 8 7 6 5 4 3 25 24 21 23 2 26 1 d15ed8 20 w (write) 22 27 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 e (enable) g (oe) 11 12 13 15 16 17 18 19 10 9 8 7 6 5 4 3 25 24 21 23 2 26 1 d23ed16 20 w (write) 22 27 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 e (enable) g (oe) 11 12 13 15 16 17 18 19 10 9 8 7 6 5 4 3 25 24 21 23 2 26 1 byte 3 low-order byte d7ed0 cs3 cs3 cs3 cs3 oe we3 we2 we1 we0 oe r/w oe a16ea2 a16ea2 a16ea2 a16ea2 mcm6206c 32k 8 static ram mcm6206c 32k 8 static ram byte 0 high-order byte byte 1 middle-high byte mcm6206c 32k 8 static ram mcm6206c 32k 8 static ram system bus and quicc-generated signals oe
applications 9-84 mc68360 user? manual motorola 9.8.2.4 eeprom. figure 9-31 shows the interface to an eeprom device to give a small amount of nonvolatile storage. in this case a byte-wide eeprom bank is defined to mini- mize cost. if the port size of the chip select is selected to be 8-bits, then each byte of the eeprom may be accessed in succession. the cs4 pin should be programmed to respond to an 8k byte area in this design. only one byte should be written at a time. after a write is made, software is responsible for waiting the appropriate time (e.g. 10 ms) or for doing data polling to see if the newly written data byte is correct. figure 9-31. 8-kbyte eeprom bank? bits wide 9.8.2.5 dram simm. figure 9-32 shows the interface to an mcm32100s dram single in- line memory module (simm). both the mc68ec030 and the quicc can access the dram. when the quicc is a slave to an external mc68ec030, the address multiplexing for the dram must be done externally to the quicc, which is accomplished in the three f157 mul- tiplexers. the external address multiplexing scheme is very simple and allows page mode operation to be provided for the mc68ec030, if desired. this multiplexing scheme exter- nally provides, the same multiplexing method that the quicc implements internally. note this multiplexing scheme allows the use of page mode, but re- quires hardware modification if larger simms are to be used on the board. if the user is interested in the latter, rather than the we (write) a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 dq0 dq1 dq2 dq3 dq4 dq5 dq6 dq7 ce (enable) oe 2864 8k 8 eeprom byte port size a12ea0 d31ed24 system bus and quicc-generated signals cs4 r/w we3
applications 9-85 mc68360 user? manual motorola former, see the dram multiplexing scheme in 9.4 using the quicc mc68040 companion mode. figure 9-32. 4-mbyte dram bank?2 bits wide ma0 ma1 ma2 ma3 ma4 ma5 ma6 ma7 ma8 ma9 ras1 ras1dd cas0 cas1 cas2 cas3 r/w d7?0 d15?8 d23?16 d31?24 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 ras0 ras2 cas0 cas1 cas2 cas3 w dq7?q0 dq15?q8 dq23?q16 dq31?q24 a0 a1 a2 a3 b0 b1 b2 b3 y0 y1 y2 y3 oe sel a0 a1 a2 a3 b0 b1 b2 b3 y0 y1 y2 y3 oe sel a0 a1 a2 a3 b0 b1 b2 b3 y0 y1 y2 y3 oe sel amux a2 a3 a4 a5 a12 a13 a14 a15 a6 a7 a8 a9 a16 a17 a18 a19 a10 a11 a20 a21 ma0 ma1 ma2 ma3 ma4 ma5 ma6 ma7 ma8 ma9 ma10 ma11 column = a row = b muxed address bus note: ma11?a10 not used. mc74f157 mc74f157 mc74f157 mcm32100s 1m 32 bit dram module 1m 4 1m 4 1m 4 1m 4 1m 4 1m 4 1m 4 1m 4 system bus and quicc-generated signals
applications 9-86 mc68360 user? manual motorola this design also uses the ras1 double-drive capability, whereby the ras1dd signal is out- put by the quicc on the bclri pin to increase the effective drive capability of the ras1 signal. the ras1 line should be programmed to respond to a 4-mbyte address space. after power-on reset, the software must wait the required time before accessing the dram. the required eight read cycles must then be performed either in software or by waiting for the refresh controller to perform these accesses. 9.8.2.6 dram devices. figure 9-33 shows the interface to a standalone dram device. in this case the mcm54260 256k 16 dram device is chosen. this allows a full 32-bit wide dram solution using only two dram devices, with byte writes still supported using the upper and lower cas pins. both the mc68ec030 and the quicc can access the dram array. the ras1 line should be programmed to respond to a 1-mbyte address space. the address multiplexing scheme shown is the same as that for the dram simm. no parity support is provided in this case. the ras1dd signal is not used in this case, since only two devices are supported. after power-on reset, the software must wait the required time before accessing the dram, and then perform the required eight read cycles, either in software or by waiting for the refresh controller to perform these accesses. 9.8.3 software configuration the following paragraphs discuss a number of key points for a software engineer desiring to initialize the system. the only items discussed are those that are required to allow the pre- viously discussed hardware configuration. 9.8.3.1 basic initialization. the following register initializations are basic to all types of applications. the module base address register (mbar) should be set as desired. however, the quicc 8-kbyte block should not overlap any memory array. the module base address register enable (mbare) should not be accessed. in the module configuration register (mcr), astm and bstm should be set to indicate syn- chronous operation. shen1?hen0 should be cleared. in the system protection control register (sypcr), dbfe should be cleared. bme should be set. if the software watchdog is used, the swri bit should be set. the periodic interrupt control register (picr) may be set as desired. the port e pin assignment register (pepar) should be set to $51c0. this configures three ioutx lines to go out on the unused parity pins, the ras1dd pin, we lines instead of the a31?28 lines, the amux pin (assuming dram is used in the system; otherwise, the oe function should be programmed), four casx lines, cs7 , and aveco .
applications 9-87 mc68360 user? manual motorola figure 9-33. 1-mbyte dram bank?2 bits wide 9.8.3.2 configuring the memory controller. the following register initializa- tions are for the memory controller. the global memory register (gmr) should be configured as follows: the rfcnt bits may be set as desired. at 25 mhz, an rfcnt value of 24 (decimal) gives ma0 ma1 ma2 ma3 ma4 ma5 ma6 ma7 ma8 dq15?q0 ras ucas lcas w a0 a1 a2 a3 b0 b1 b2 b3 y0 y1 y2 y3 sel system bus and quicc-generated signals a0 a1 a2 a3 b0 b1 b2 b3 y0 y1 y2 y3 oe sel a0 a1 a2 a3 b0 b1 b2 b3 y0 y1 y2 y3 sel amux a2 a3 a4 a5 a12 a13 a14 a15 a6 a7 a8 a9 a16 a17 a18 a19 a10 a11 a20 a21 ma0 ma1 ma2 ma3 ma4 ma5 ma6 ma7 ma8 ma9 ma10 ma11 column = a row = b muxed address bus mcm54260 256k 16 bit dram a0 a1 a2 a3 a4 a5 a6 a7 a8 d15?0 r/w cas2 bytes 2 & 3 low-order word cas3 ras1 ma0 ma1 ma2 ma3 ma4 ma5 ma6 ma7 ma8 dq15?0 ras ucas lcas w mcm54260 dram a0 a1 a2 a3 a4 a5 a6 a7 a8 d31?16 r/w cas0 bytes 0 & 1 high-order word cas1 ras1 note: ma11?a9 not used. mc74f157 mc74f157 mc74f157 oe oe 256k 16 bit
applications 9-88 mc68360 user? manual motorola one refresh every 15.6 m s. rfen should be set. rcyc depends on the dram speed. at 25 mhz (an 80-ns dram simm), rcyc should be 00. pgs2?gs0 should be set to 011 for the 1m 32 dram simm. dps should be set to 00 (32-bit dram port size). wbt40 does not apply to this application. wbtq depends on timing; it should be set for 80-ns mcm32100 simms. dwq should be set if page mode enabled (pgme = 1). dw40 does not apply to this application. emws is not used in synchronous mode. (sync = 1) sync should be set for a synchronous operation of the memory controller. opar does not apply to this application. pbee does not apply to this application. tss40 does not apply to this application. ncs should normally be cleared. gamx should be cleared for an external master system. the memory controller status register (mstat) is used for reporting write protect and parity errors and does not require initialization. the eight base registers (brs), one for each memory bank, should be configured as follows: the ba27?a11 bits may be set as desired. different memory arrays should not overlap. ba31?a28 should be cleared since the byte write lines are used with an external master in the system. for simplicity, fc3?c0 can be cleared. trlxq depends on timing of memory/peripheral. back40 does not apply to this application. csnt40 does not apply to this application. csntq should normally be cleared. paren should be cleared since parity is not used in this application. wp should be set for eprom and flash eprom; otherwise, it should be cleared. v should be set if the memory bank is used. the eight option registers (ors), one for each memory bank, should be configured as fol- lows: the tcyc bits should be set to determine the number of wait states required.
applications 9-89 mc68360 user? manual motorola the am27?m11 bits should be programmed to determine the block size of the chip se- lect or rasx line. this should be the total number of bytes in each memory array except for the eeprom, which should be 32 kbytes, rather than 8 kbytes. fcm3?cm0 may be set to all ones to allow the chip select or rasx line to assert on all function codes except cpu space (interrupt acknowledge). it is advisable to program fcm3?cm0 to ones, at least during the initial stages of debugging. bcyc1?cyc0 is not applicable. pgme should be set to enable page mode and cleared otherwise. sps1?ps0 should be cleared (32-bit sram port). dssel should be set only if this is a dram bank. 9.8.4 interfacing multiple quiccs to an mc68ec030 it is possible to interface multiple quiccs to an mc68ec030. the first quicc can be con- figured as previously shown in this subsection. additional quiccs should be configured as noted in the following list: the additional quiccs should have their config2?onfig0 pins configured for slave mode, global chip select disabled , and mbar at $003ff04. the mbar of the additional quiccs should be programmed using the mbare pin and mbare register as described in the section 6 system integration module (sim60). an external bus arbiter is required to take the bus request of the additional quicc (which is an output because of the config2?onfig0 pins) and prioritize it with the other quiccs, present it to the mc68ec030, and issue a bus grant to the appropriate quicc. an external interrupt prioritizer is required to determine which quicc iout2 ?out0 pins are currently routed to the mc68ec030. alternatively, the additional quicc should have its interrupts brought out on a single rqout pin, which is routed to one of the original quicc interrupt inputs. this would eliminate the external logic. 9.8.5 using a higher speed mc68ec030 master with the quicc it is possible to interface an mc68ec030 and quicc through an asynchronous bus. this should allow an external master to operate at higher frequencies than those of the quicc with minimal effort. as of this writing, the quicc top frequency is 25 mhz; whereas, mc68ec030s are available up to 40 mhz. one potentially attractive option for a designer would be to consider disabling the cpu32+ core and increasing system performance by adding a 40-mhz mc68ec030 asynchronously. while this option is available, it is important for the designer to consider what effects a higher speed mc68ec030 would ultimately have on system cost and performance over using the quicc cpu32+ at a lower frequency. for the designer to take full advantage of a high-speed mc68ec030, it will be necessary to add additional glue to that shown in figure 9-27. the additional circuitry takes the form of a dram controller, which is used instead of using the quicc memory controller. the need for the additional logic is twofold. first, if the quicc memory controller capabilities are used, all memory accesses would be at the clock rate of 25 mhz. in addition, since the
applications 9-90 mc68360 user? manual motorola mc68ec030 signals must be synchronized internally with the quicc, additional wait states will be introduced. for applications with any significant level of external memory accesses, this would limit the additional cost/performance benefit of a 40-mhz mc68ec030. the sec- ond reason for needing an external dram controller is found by taking a closer look at how the quicc memory controller would interface with a high-speed mc68ec030. the signal interaction that would occur if two consecutive writes were performed is shown in figure 9-27. after the assertion of dsackx by the quicc on a 25-mhz edge, the 40-mhz mc68ec030 would recognize dsackx on the next falling 40-mhz edge, and proceed to negate as one cycle after that. the problem is that the mc68ec030 begins another write cycle one-half mc68ec030 clock cycle later, and one-half clock cycle into that write cycle, as is asserted. in asynchronous mode, since external signals are synchronized to the quicc on quicc falling clock edges, at 25 mhz there is no guarantee that the quicc will see the negated as, which is present for only one mc68ec030 cycle (25 ns). to take advantage of the quicc memory controller capabilities, it would be necessary for designers to address issues like this. this task would need to be done with external hard- ware, such as a state machine, to ensure conformity to the quicc electrical specifications. a second option would be to use an external memory controller and use the quicc to gen- erate only the chip selects. either option will require additional hardware. designers considering an asynchronous interface also need to address timing issues asso- ciated with using the quicc memory controller capabilities. when the quicc provides the bus control for a system, it is offered at the speed of the quicc. therefore, a 40-mhz mc68ec030 will access the bus at 25 mhz. in addition, since the mc68ec030 signals must be synchronized with the quicc, additional wait states will be introduced. since the exact timing will depend on the type and speed of memory access, no exhaustive analysis is pro- vided. the primary advantage of an mc68ec030 over the cpu32+ would be the onboard cache and the new instructions. whether this advantage would outweigh the potential timing disadvantages will vary depending on system hardware and software considerations. in any case, the quicc makes a valuable peripheral chip in an mc68030-based design because of the wealth of serial functions it offers, even if the memory controller on the quicc is not extensively used in such a design. 9.9 putting a background debug mode connector on a target board the quicc, as well as other members of the m68300 family of integrated processors, con- tains a background debug mode (bdm). the bdm is essentially a debugger that is built into the cpu32+ on the quicc. the user can communicate with the cpu32+ through the bdm port on the quicc. the bdm pins on the quicc can be used in a number of ways. first, emulator manufactur- ers use these pins in the development of their quicc emulator products. this use of the bdm pins is usually unseen and completely transparent to the user. second, vendors of debug monitors use the bdm pins for offering low-cost debug monitor products. in this way, the target board can be monitored and debugged using a debugger resident on a pc. third, some users develop their own bdm interface software to solve special debugging and test-
applications 9-91 mc68360 user? manual motorola ing needs (such as in-field debugging). in the second and third cases, the target board needs to provide the bdm pins exposed so that an external monitor/debugger can connect to the target board. figure 9-34 simply shows a standard connector for use with bdm equip- ment. the standard connector originally an 8-pin connector, has been expanded to 10 pins as shown in figure 9-34. this connector is sometimes referred to as the berg connector. it has the standard 0.1-inch spacing between pins. the original 8 pins on the connector are the lower 8 pins (pins 3?0). if a debug monitor provides an 8-pin bdm connector, it should be plugged onto the original 8 pins. the additional 2 pins were added to allow hardware break- points to be implemented using the bdm connector. since the quicc contains an on-chip breakpoint address register with masking, this function can be implemented on-chip. to do this, the user can load the breakpoint address register in the sim60 using the debugger commands (or under normal program control). once execution of the program resumes, an address breakpoint then causes the quicc to reenter bdm. figure 9-34. bdm connector ds 1 gnd 3 gnd 5 reseth 7 vdd 9 2 berr 4 bkpt/dsclk 6 freeze 8 ifetch/dsi 10 ipipe0/dso notes: 1. on other m68300 family devices reseth is simply reset, and ipipe0 is simply ipipe. 2. the original 8-pin connector consists of pins 3 through 10.
applications 9-92 mc68360 user? manual motorola
motorola mc68360 user? manual 10-1 section 10 electrical characteristics this section contains detailed information on power considerations, dc/ac electrical char- acteristics, and ac timing specifications of the mc68360. refer to section 11 ordering infor- mation and mechanical data for specific part numbers corresponding to voltage, frequency, and temperature ratings. 10.1 maximum ratings notes: 1. permanent damage can occur if maximum ratings are exceeded. exposure to voltages or currents in excess of recommended values affects device reliability. device modules may not operate normally while being exposed to electrical extremes. 2. although sections of the device contain circuitry to protect against damage from high static voltages or electrical ?lds, take normal precautions to avoid exposure to voltages higher than maximum-rated voltages. the following ratings define a range of conditions in which the device will operate without being damaged. however, sections of the device may not operate normally while being exposed to the electrical extremes. rating symbol value unit this device contains protective cir- cuitry against damage due to high static voltages or electrical fields; however, it is advised that normal precautions be taken to avoid appli- cation of any voltages higher than maximum-rated voltages to this high- impedance circuit. reliability of oper- ation is enhanced if unused inputs are tied to an appropriate logic volt- age level (e.g., either gnd or v dd ). supply voltage 1, 2 v cc ?.3 to +6.5 v input voltage 1, 2 v in ?.3 to +6.5 v operating temperature range (cqfp and pga for normal and extended temperature part) t a 0 to 70 or ?0 to +85 c maximum operating junction tempera- ture (bga only) t j 115 c minimum operation ambient temperature (bga only) t a 0 c storage temperature range t stg ?5 to +150 c thi d t t d ith f m k 4 0 4
electrical characteristics 10-2 mc68360 user? manual motorola 10.2 thermal characteristics notes: 1. assumes natural convection and a single layer board (no thermal vias). 2. assumes natural convection, a multi layer board with thermal vias 4 , 1.5 watt 68360 dissipation, and a board temperature rise of 30 c above ambient. 3. assumes natural convection, a multi layer board with thermal vias 4 ,1.5 watt 68360 dissipation, and a board temperature rise of 15 c above ambient. 4. for more information on the design of thermal vias on multilayer boards and bga layout considerations in general, refer to an-1231/d, ?lastic ball grid array application note?available from your local motorola sales of?e. 10.3 power considerations the average chip-junction temperature, t j , in c can be obtained from: t j = t a + (p d ? q ja ) (1) where: t a = ambient temperature, c q ja = package thermal resistance, junction-to-ambient, c/w p d =p int + p i/o pint =i cc x v cc , watts?hip internal power p i/o = power dissipation on input and output pins?ser determined for most applications, p i/o < 0.3*p int and can be neglected. an approximate relationship between p d and t j (if p i/o is neglected) is: p d = k ? (t j + 273 c) (2) solving equations (1) and (2) for k gives: k = p d ?(t a + 273 c) + q ja ?p d 2 (3) characteristic symbol value unit thermal resistance?unction to case 240-pin qfp 241-pin pga 357-pin bga q jc 2 7 8 c/w thermal resistance?unction to ambient 240-pin qfp 241-pin pga q ja 27.4 22.8 c/w thermal resistance?unction to ambient 357-pin bga q ja 47 1 c/w 30 2 20 3 t j = t a + (p d q ja ) p d = (v dd i dd ) + p i/o where: p i/o is the power dissipation on pins.
electrical characteristics motorola mc68360 user? manual 10-3 where k is a constant pertaining to the particular part. k can be determined from equation (3) by measuring p d (at thermal equilibrium) for a known t a . using this value of k, the values of p d and t j can be obtained by solving equations (1) and (2) iteratively for any value of t a . 10.4 ac electrical specification definitions the ac specifications presented consist of output delays, input setup and hold times, and signal skew times. all signals are specified relative to an appropriate edge of the clock and possibly to one or more other signals. the measurement of the ac specifications is defined by the waveforms shown in figure 10- 1. to test the parameters guaranteed by motorola, inputs must be driven to the voltage lev- els specified in the figure. outputs are specified with minimum and/or maximum limits, as appropriate, and are measured as shown. inputs are specified with minimum setup and hold times and are measured as shown. finally, the measurement for signal-to-signal specifica- tions are shown. note that the testing levels used to verify conformance to the ac specifications do not affect the guaranteed dc operation of the device as specified in the dc electrical characteristics.
electrical characteristics 10-4 mc68360 user? manual motorola figure 10-1. drive levels and test points for ac specifications 0.8 v 2.0 v b 2.0 v 0.8 v valid output n valid output n + 1 2.0 v 0.8 v 2.0 v 0.8 v 2.0 v 0.8 v valid output n valid output n+1 2.0 v 0.8 v b a valid input 2.0 v 0.8 v 2.0 v 0.8 v d valid input 2.0 v 0.8 v 2.0 v 0.8 v d drive to 0.5 v drive to 2.4 v 2.0 v 0.8 v 2.0 v 0.8 v f clkout outputs(1) outputs(2) inputs(3) inputs(4) all signals(5) notes: 1. this output timing is applicable to all parameters specified relative to the rising edge of the clock. 2. this output timing is applicable to all parameters specified relative to the falling edge of the clock. 3. this input timing is applicable to all parameters specified relative to the rising edge of the clock. 4. this input timing is applicable to all parameters specified relative to the falling edge of the clock. 5. this timing is applicable to all parameters specified relative to the assertion/negation of another signal. legend: a. maximum output delay specification. b. minimum output hold time. c. minimum input setup time specification. d. minimum input hold time specification. e. signal valid to signal valid specification (maximum or minimum). f. signal valid to signal invalid specification (maximum or minimum). e a c c
electrical characteristics motorola mc68360 user? manual 10-5 10.5 dc electrical specifications (gnd = 0 vdc, ta = 0 to 70 c; the electrical specifications in this document are preliminary; see numbered notes) characteristic symbol min max unit input high voltage (except extal) v ih 2.0 v cc v input low voltage v il gnd 0.8 v input low voltage (3.3v part only; pa8-15, pb1, pc5, pc7 tck) v il gnd 0.5 v input low voltage (3.3v part only; all other pins) v il gnd 0.8 v extal input high voltage v ihc 0.8 * (v cc )v cc +0.3 v undershoot ?.8 v input leakage current (all input only pins except for tms, tdi and trst) v in = v cc or gnd i in ?.5 2.5 m a hi-z (off-state) leakage current (all noncrystal outputs and i/o pins) v in = 0.5/2.4 v i oz ?0 20 m a signal low input current v il = 0.8 v (tms, tdi and trst pins only) signal high input currentv ih = 2.0 v(tms, tdi and trst pins only) i l ih ?.5 ?.5 0.5 0.5 ma ma output high voltage i oh = ?.8 ma, v cc = 4.75 v all noncrystal outputs except open drain pins v oh 2.4 v output low voltage (for 5 volt part) i ol = 2.0 maclko1? ,freeze, ipipe0 ? , ifetch , bkpto i ol = 3.2 maa31?0, d31?0, fc3?, siz0?, pa0, 2, 4, 6, 8?5, pb0?, pb8?7, pc0?1, tdo, perr , prty0?, iout0 ? , aveco , as, cas3? , blcro , ras0 ? i ol = 5.3 ma, dsack0? , r/w , ds , oe , rmc , bg , bgack , berr i ol = 7 matxd1? i ol =8.9 mapb6, pb7, halt , reset , br (output) v ol 0.5 0.5 0.5 0.5 0.5 v output low voltage (for 3.3 volt part) i ol = 2.0 maa31?0, fc3?, siz0?, d31?0, prty0?,clko1? ,freeze, ipipe0 ? , ifetch , bkpto i ol = 3.2 ma pa0, 2, 4, 6, 8?5, pb0?, pb8?7, pc0?1, tdo, perr , prty0?, iout0 ? , aveco , as, cas3? , blcro , ras0 ? i ol = 5.3 ma, dsack0? , r/w , ds , oe , rmc , bg , bgack , berr i ol = 7 matxd1? i ol =8.9 mapb6, pb7, halt , reset , br (output) v ol 0.5 0.5 0.5 0.5 0.5 v input capacitance all i/o pins c in 20 pf load capacitance (except clko1?) c l 100 pf load capacitance ( clko1-2) c l c 50 pf power (for 5 volt version) vcc 4.75 5.25 v power (for 3.3 volt version) vcc 3.0 3.6 v minimum vcc ramp up time on power on reset t ranp 4 msec
electrical characteristics 10-6 mc68360 user? manual motorola 10.6 ac power dissipation notes: 1. rev a mask is c63t 2. rev b masks are c69t, and f35g 3. current rev c masks are e63c, e68c and f15w 5. extal frequency is 32khz all measurements was taken with only clko1 enabled, vcc = 5.0v, v il = 0v and v ih = vcc notes: 1. rev a mask is c63t 2. rev b masks are c69t, and f35g 3. current rev c masks are e63c, e68c and f15w t ypical curent drain mode of operation symbol system clock frequency brgclk clock frequency syncclk clock frequency typ unit normal mode ( rev a 1 and rev b 2 ) i dd 25 mhz 25 mhz 25 mhz 250 ma normal mode ( rev c 3 and newer) i dd 25 mhz 25 mhz 25 mhz 237 ma normal mode i dd 33 mhz 33 mhz 33 mhz 327 ma low power mode i ddsb divide by 2 12.5 mhz divide by 16 1.56 mhz divide by 2 12.5 mhz 150 ma low power mode i ddsb divide by 4 6.25 mhz divide by 16 1.56 mhz divide by 4 6.25 mhz 85 ma low power mode i ddsb divide by 16 1.56 mhz divide by 16 1.56 mhz divide by 4 6.25 mhz 35 ma low power mode i ddsb divide by 256 97.6 khz divide by 16 1.56 mhz divide by 4 6.25 mhz 20 ma low power mode i ddsb divide by 256 97.6 khz divide by 64 390 khz divide by 64 390 khz 13 ma low power stop vco off 5 i ddsp 0.5 ma pll supply current pll disabled pll enabled i ddpd i ddpe tbd tbd maximum power dissipation system frequency vcc max p d unit mask 25mhz 5.25 v 1.80 w rev a 1 and rev b 2 25mhz 5.25 v 1.45 w rev c 3 and newer 25mhz 3.6 v 0.65 w rev c 3 and newer 33mhz 5.25 v 2.00 w rev c 3 and newer
electrical characteristics motorola mc68360 user? manual 10-7 10.7 ac electrical specifications control timing (gnd = 0 vdc, ta = 0 to 70 c; the electrical specifications in this document are preliminary; see figure 10-2) note: 1. note that the minimum vco frequency and the pll default values put some restrictions on the minimum system frequency. a: the following calculation should be used to determine the actual value for specifications 5b, 5c and 5d. 5b : 25mhz +/-(0.9ns + 0.25 x (rise time)) (1.4ns@rise=2ns; 1.9ns@rise=4ns) 33mhz +/-(0.5ns + 0.25 x (rise time)) (1ns@rise=2ns; 1.5ns@rise=4ns) 5c : 25/33mhz +/-(2ns + 0.25 x (rise time)) (2.5ns@rise=2ns; 3ns@rise=4ns) 5d : 25mhz +/-(3ns + 0.5 x (rise time)) (4ns@rise=2ns; 5ns@rise=4ns) 33mhz +/-(2.5ns + 0.5 x (rise time)) (3.5ns@rise=2ns; 4.5ns@rise=4ns) num. characteristic symbol 3.3 v or 5.0 v 5.0 v unit 25 mhz 33.34 mhz min max min max system frequency f sys dc 1 25.00 33.34 mhz crystal frequency f xtal 25 6000 25 6000 khz on-chip vco system frequency f sys 20 50 20 67 mhz start-up time with external clock (oscillator disabled) or after changing the multiplication factor mf. t pll 2500 clks clko1? stability d clk tbd tbd % 1 clko1 period t cyc 40?0ns 1a extal duty cycle, mf t dcyc 40 60 40 60 % 1c external clock input period t extcyc 40?0ns 2, 3 clko1 pulse width (measured at 1.5v) t cw1 19?4ns 2a, 3a clko2 pulse width (measured at 1.5v) t cw2 9.5 7 ns 4, 5 clko1 rise and fall times (full drive) t crf1 ??ns 4a, 5a clko2 rise and fall times (full drive) t crf2 ??ns 5b extal to clko1 skew?ll enabled (mf<5) t extp1 aans 5c extal to clko2 skew?ll enabled (mf<5) t extp2 aans 5d clko1 to clko2 skew t cskw aans
electrical characteristics 10-8 mc68360 user? manual motorola figure 10-2. clock timing 10.8 external capacitor for pll note: 1. mf ?multiplication factor. examples: 1. modck1 pin = 0, mf = 1 t c xfc = 400 pf 2. modck1 pin = 1, crystal is 32.768 khz (or 4.192 mhz), initial mf = 401, initial fre- quency = 13.14 mhz, later on mf is changed to 762 to support a frequency of 25 mhz. minimum c xfc is: 762 x 380 = 289 nf, maximum c xfc is: 401 x 970 = 390 nf. the recommended c xfc for 25 mhz is: 762 x 540 = 414 nf. 289 nf < c xfc < 390 nf and closer to 414 nf. the proper available value for c xfc is 390 nf. 3. modck1 pin = 1, crystal is 32.768 khz (or 4.192 mhz), initial mf = 401, initial fre- quency = 13.14 mhz; later, mf is changed to 1017 to support a frequency of 33.34 mhz. minimum c xfc is: 1017 x 380 = 386 nf. maximum c xfc is: 401 x 970 = 390 nf t 386 nf < c xfc < 390 nf. the proper available value for c xfc is 390 nf. 3a. in order to get higher range, higher crystal frequency can be used (i.e. 50 khz), in this case: minimum c xfc is: 667 x 380 = 253 nf. maximum c xfc is: 401 x 970 = 390 nf t 253 nf < c xfc < 390 nf. characteristic symbol 3.3v 5.0 v unit min max min max pll external capacitor (xfc to vccsyn) mf<5 (recommended value mf 400 pf) mf>4 (recommended value mf 540 pf) c xfc mfx680 mfx760 mfx960 mfx1940 mfx340 mfx380 mfx480 mfx970 pf pf extal clko1 clko2 (input) (output) (output) 5 4 1 1c 2 3 2a 3a 4a 5a 5c 5b 5d voltage midpoint 1a
electrical characteristics motorola mc68360 user? manual 10-9 10.9 bus operation ac timing specifications (the electrical specifications in this document are preliminary; see figure 10-3?igure 10-19) num. characteristic symbol 3.3 v/5.0 v 5.0v unit 25.0 mhz 33.34mhz min max min max 6 clko1 high to address, fc, siz, rmc valid t chav 0 15 0 12 ns 6a clko1 high to address valid (gamx=1) t chav 0 20 0 15 ns 7 clko1 high to address, data, fc, siz, rmc high impedance t chazx 0 40 0 30 ns 8 clko1 high to address, fc, siz, rmc invalid t chazn 0 0 ns 9 clko1 low to as , ds , oe , we , ifetch , ipipe, iack? asserted t clsa 3 20 3 15 ns 9 10 clko1 low to cs?/ras? asserted t clsa 4 16 4 12 ns 9b 11 clko1 high to cs?/ras? asserted t chca 4 16 4 12 ns 9a 2,10 as to ds or cs?/ras? or oe asserted (read) t stsa ? 6 -5.625 5.625 ns 9c 2,11 as to cs?/ras? asserted t stca 14 26 9 21 ns 11 10 address, fc, siz, rmc valid to as , cs?/ras?, oe, we (and ds read) asserted t avsa 10 8 ns 11a 11 address, fc, siz, rmc valid to cs?/ras? as- serted t avca 30 ns 12 12 clko1 low to as , ds , oe, we , ifetch, ipipe, iack? negated t clsn 3 20 3 15 ns 12 16 clko1 low to cs?/ras? negated t clsn 4 16 4 12 ns 12a 13,16 clko1 high to cs?/ras? negated t chcn 4 16 4 12 ns 12b cs negate to we negate (csntq=1) t cstw 15 12 ns 13 12 as , ds , cs? , oe , we , iack? negated to ad- dress, fc, siz invalid (address hold) t snai 10 7.5 ns 13a 13 cs? negated to address, fc, siz invalid (ad- dress hold) t cnai 30 ns 14 10,12 as , cs?, oe, we (and ds read) width asserted t swa 75 ns 14c 11,13 cs? width asserted t cwa 35 ns 14a ds width asserted (write) t swaw 35 ns 14b as , cs? , oe , we , iack? (and ds read) width asserted (fast termination cycle) t swdw 35 ns 14d 13 cs? width asserted (fast termination cycle) t cwdw 15 10 ns 15 3,10,12 as , ds , cs?, oe, we width negated t sn 35 ns 16 clko1 high to as , ds , r/ w high impedance t chsz 40 30 ns 17 12 as , ds , cs?, we negated to r /w high t snrn 10 7.5 ns 17a 13 cs? negated to r/ w high t cnrn 30 ns 18 clko1 high to r/ w high t chrh 0 20 0 15 ns 20 clko1 high to r/ w low t chrl 0 20 0 15 ns 21 10 r/ w high to as , cs?, oe asserted t raaa 10 7.5 ns
electrical characteristics 10-10 mc68360 user? manual motorola 10.9 bus operation ac timing specifications (continued) num. characteristic symbol 3.3 v/5.0 v 5.0v unit 25.0 mhz 33.34mhz min max min max 21a 11 r/ w high to cs? asserted t raca 30 ns 22 r/ w low to ds asserted (write) t rasa 47 36 ns 23 clko1 high to data-out, parity-out valid t chdo ?3 ?5 ns 23a clko1 high to parity valid t chpv ?5 ?5 ns 23b parity valid to cas low t pvcl 3 3 ns 24 12 data-out, parity-out valid to negating edge of as , cs?, we , (fast termination write) t dvasn 10 7.5 ns 25 12 ds , cs? , we negated to data-out, parity-out invalid (data- out, parity-out hold) t sndoi 10 7.5 ns 25a 13 cs? negated to data-out, parity-out invalid (data-out, par- ity-out hold) t cndoi 35 25 ns 26 data-out, parity-out valid to ds asserted (write) t dvsa 10 7.5 ns 27 15 data-in, parity-in to clko1 low (data setup) t dicl 1 1 ns 27b 14 data-in, parity-in valid to clko1 low (data setup) t dicl 20 15 ns 27a late berr , halt , bkpt asserted to clko1 low (setup time) t belcl 10 7.5 ns 28 18 as , ds negated to dsack? , berr , halt negated t sndn 0 50 0 37.5 ns 29 4 ds , cs?, oe negated to data-in, parity-in invalid (data-in, parity-in hold) t sndi 0 0 ns 29a 4 ds , cs?, oe negated to data-in high impedance t shdi 40 30 ns 30 4 clko1 low to data-in, parity-in invalid (fast termination hold) t cldi 10 7.5 ns 30a 4 clko1 low to data-in high impendance t cldh 60 45 ns 31 5,15 dsack? asserted to data-in, parity-in valid t dadi 32 24 ns 31a dsack? asserted to dsack? valid (skew) t dadv 10 7.5 ns 31b 5,14 dsack? asserted to data-in, parity-in valid t dadi 35 26 ns 32 halt and reset input transition time t hrrf 140 ns 33 clko1 high to bg asserted t clba 20 15 ns 34 clko1 high to bg negated t clbn 20 22.5 15 ns 35 6 br asserted to bg asserted ( rmc not asserted) t braga 1 1 clko1 37 bgack asserted to bg negated t gagn 1 2.5 1 2.5 clko1 39 bg width negated t gh 2 2 clko1 39a bg width asserted t ga 1 1 clko1 46 r/ w width asserted (write or read) t rwa 100 75 ns 46a r/ w width asserted (fast termination write or read) t rwas 75 56 ns 47a asynchronous input setup time t aist 5 4 ns 47b asynchronous input hold time t aiht 10 7.5 ns
electrical characteristics motorola mc68360 user? manual 10-11 10.9 bus operation ac timing specifications (continued) num. characteristic symbol 3.3 v/5.0 v 5.0v unit 25.0 mhz 33.34mhz min max min max 48 5,7 dsack? asserted to berr , halt asserted t daba ?0 22.5 ns 49 clko1 high to berr , resets , reseth output low t chro ns 53 data-out, parity-out hold from clko1 high t doch 0 0 ns 54 clko1 high to data-out, parity-out high impedance t chdh ?0 15 ns 55 r/ w asserted to data bus impedance change t radc 25 19 ns 56 reset pulse width (reset instruction) t hrpw 512 512 clko1 56a reset pulse width (input from external device) t rpwi 20 20 clko1 57 berr negated to halt negated (rerun) t bnhn 0 0 ns 58 clko1 high to berr , resets , reseth driven low t chbrl ?0 26 ns 58a clko1 low to resets driven low (upon reset instruction execution only) t clrl ?0 26 ns 60 clko1 high to bclro asserted t chbca ?0 15 ns 61 clko1 high to bclro negated t chbcn ?0 15 ns 62 9 br synchronous setup time t brsu 5 3.75 ns 63 9 br synchronous hold time t brh 10 7.5 ns 64 9 bgack synchronous setup time t bgsu 5 3.75 ns 65 9 bgack synchronous hold time t bgh 10 7.5 ns 66 br low to clko1 rising edge (040 comp. mode) t brch 5 5 ns 70 clko1 low to data bus driven (show cycle) t scldd 030 0 22.5 ns 71 data setup time to clko1 low (show cycle) t sclds 10 7.5 ns 72 data hold from clko1 low (show cycle) t scldh 6 3.75 ns 73 bkpt input setup time t bkst 10 7.5 ns 74 bkpt input hold time t bkht 6 3.75 ns 75 reseth low to config2?, mod1?, b16m valid t mst 500 500 clko1 76 config2? t msh 0 0 ns 77 mod1? hold time, b16m hold time t msh 10 10 clko1 80 dsi input setup time t dsisu 10 7.5 ns 81 dsi input hold time t dsih 6 3.75 ns 82 dsclk setup time t dscsu 10 7.5 ns 83 dsclk hold time t dsch 6 3.75 ns 84 dso delay time t dsod ? cyc + 20 tcyc+ 20 ns 85 dsclk cycle t dsccyc 2 2 clko1 86 clko1 high to freeze asserted t frza 035 0 26.25 ns 87 clko1 high to freeze negated t frzn 035 0 26.25 ns
electrical characteristics 10-12 mc68360 user? manual motorola 10.9bus operation ac timing specifications (continued notes: 1. all ac timing is shown with respect to 0.8 v and 2.0 v levels unless otherwise noted. 2. this number can be reduced to 5 ns if strobes have equal loads. 3. if multiple chip selects are used, the cs? width negated (#15) applies to the time from the negation of a heavily load- ed chip select to the assertion of a lightly loaded chip select. 4. these hold times are specified with respect to ds or cs? on asynchronous reads and with respect to clko1 on fast termination reads. the user is free to use either hold time for fast termination reads. 5. if the asynchronous setup time (#47) requirements are satisfied, the dsack? low to data setup time (#31) and dsack? low to berr low setup time (#48) can be ignored. the data must only satisfy the data-in to clko1 low setup time (#27) for the following clock cycle: berr must only satisfy the late berr low to clko1 low setup time (#27a) for the following clock cycle. 6. to ensure coherency during every operand transfer, bg will not be asserted in response to br until after cycles of the current operand transfer are complete and rmc is negated. 7. in the absence of dsack? , berr is an asynchronous input using the asynchronous setup time (#47). 8. during interrupt acknowledge cycles, the processor may insert up to two wait states between states s0 and s1. 9. these specs are for synchronous arbitration only. astm=1. 10.these cs? specs are for trlx=0. if ras? and ras?dd are connected together, reduce max value of ras? spec- ification by 1.5ns. 11.these cs? specs are for trlx=1. if ras? and ras?dd are connected together, reduce max value of ras? spec- ification by 1.5ns. 12.these cs? specs are for csntq=0. 13.these cs? specs are for csntq=1; or ras? specs for dram accesses. 14.these specs are read cycles with parity check and pbee=1. 15.these specs are read cycles with parity check and pbee=0,paren=1. 16.these ras? specs are for page miss case. 17. these specifications only apply to cs?/ras? pins. 18. this specification applies to non fast termination cycles. in fast termination cycles, the berr signal must be negated by 20ns after negation of as , ds . num. characteristic symbol 3.3 v/5.0 v 5.0v unit 25.0 mhz 33.34mhz min max min max 88 clko1 high to ifetch high impedance t ifz 035 0 26.25 ns 89 clko1 high to ifetch valid t if 035 0 26.25 ns 90 clko1 high to perr asserted t chpa 020 0 15 ns 91 clko1 high to perr negated t chpn 020 0 15 ns 92 minimum vcc ramp-up time at power-on reset t rmin 5- 5 - ms
electrical characteristics motorola mc68360 user? manual 10-13 figure 10-3. read cycle dsack0 r/w ds berr, fc3?c0 a31?0 clko1 s0 s2 s4 s1 s3 s5 6 8 11 as 14 16 9 9a 12 13 20 18 46 47a 28 29 29a d31?0 27 27a 48 9 47b 47a siz1?iz0 dsack1 ifetch ipipe1,0 asynchronous inputs halt 31 bkpt note: all timing is shown with respect to 0.8-v and 2.0-v levels. oe rmc csx 21 12 74 (output) (output) (output) (output) (output) (output) (output) (output) (output) (input) (output) (input) (input) (i/o) (i/o) 73 (output) 12 31a 15
electrical characteristics 10-14 mc68360 user? manual motorola figure 10-4. fast termination read cycle (parity check paren = 1, pbee = 0) as (output) a31?0 (output) clko1 (output) s0 s4 s0 s1 s5 8 6 9 ds (output) d31?0 (input) 12 14b 46a 30 27 30a r/w (output) csx (output) 18 bkpt (input) fc3?c0 (output) siz1?iz0 (output) oe (output) perr (output) 91 90 73 74 cpu clears pern bit s0
electrical characteristics motorola mc68360 user? manual 10-15 figure 10-5. read cycle (with parity check, pbee = 1) r/w (output) ds (output) as (output) a31?0, fc3?c0, siz1?iz0 (output) 11 14 9 9a 12 20 21 46 csx (outpuit) dsack1 (i/o) berr (input) d31?0 (input) 47a 29 27a 48 12 12 9 47a halt (input) ifetch (output) asynchronous inputs bkpt (input) rmc (output) 47b 29a note: all timing is shown with respect to 0.8-v and 2.0-v levels. clko1 (output) s0 s2 s4 s1 s3 s5 8 18 dsack0 (i/o) 6 13 oe (output) 16 28 31b prty0?rty3 (input) 73 74 27b 31a ipipe1,0 (output) 15
electrical characteristics 10-16 mc68360 user? manual motorola figure 10-6. sram: read cycle (trlx = 1) dsack0 (i/o) r/w (output) as (output) ds (output) a31?0 (output) clko1 (output) s0 s1 s2 s3 s5 s4 6 8 20 13 12 28 29 fc3?c0 (output) siz1?iz0 (output) 29a 27 d31?0 (input) 47a dsack1 (i/o) rmc (output) 9c 31 31a 11a csx (output) 9b 21a oe (output) 18 46 16 15
electrical characteristics motorola mc68360 user? manual 10-17 figure 10-7. cpu32+ iack cycle dsack0 (i/o) r/w (output) as (output) ds (output) a31?0 (output) clko1 (output) s0 s1 s2 s3 s5 s4 6 8 14 11 20 13 12 9 9a 21 18 46 iackx (output) 28 31 29 fc3?c0 (output) 29a 27 d31?0 (input) up to two wait states may be inserted by the processor between states s0 and s1. 47a 31a dsack1 (i/o) 0? clocks * * a1 a2 a3 a4 16 oe (output) siz1?iz0 (output) 15
electrical characteristics 10-18 mc68360 user? manual motorola figure 10-8. write cycle r/w (output) as (output) ds (output) a31?0 (output) clko1 (output) s0 s2 s4 s1 s3 s5 6 8 11 14 15 9 12 13 22 csn (output) 9 14a 17 dsack0 (i/o) berr (input) d31?0 (output) 47a 28 73 48 halt (input) 25 53 55 26 23 54 bkpt (input) note: all timing is shown with respect to 0.8-v and 2.0-v levels. 46 dsack1 (i/o) fc3?c0 (output) siz1?iz0 (output) wen (output) 20 74 31a prty3?rty0 (output) 18
electrical characteristics motorola mc68360 user? manual 10-19 figure 10-9. fast termination write cycle as a31?0 clko1 s0 s1 s0 r/w ds s4 s5 d31?0 wex siz1?iz0 fc3?c0 csx bkpt prty3?rty0 (input) (output) (output) (output) (output) (output) (output) (output) (output) (output) (output) (output) r/w 8 6 12 9 14b 20 46a 25 24 23 74 73 18
electrical characteristics 10-20 mc68360 user? manual motorola figure 10-10. sram: fast termination write cycle (csntq = 1) as (output) a31?0 (output) clko1 (output) s0 s1 s0 r/w ds (output) s4 s5 d31?0 wex siz1?iz0 (output) fc3?c0 (output) csx (output) prty3?rty0 (output) (output) (output) (output) 23 12a 20 18 25a 8 9 46a 6 14d
electrical characteristics motorola mc68360 user? manual 10-21 figure 10-11. sram: write cycle (trlx = 1, csntq = 1, tcyc = 0) r/w (output) as (output) ds (output) a31?0 (output) clko1 (output) s0 s2 s4 s1 s3 s5 9c csx (output) dsack0 (i/o) d31?0 (output) note: all timing is shown with respect to 0.8-v and 2.0-v levels. dsack1 (i/o) wex (output) prty0?rty3 (output) 9b 12a 13a 17a 11a 25a 20 22 46 47a 31a 55 26 23 14c
electrical characteristics 10-22 mc68360 user? manual motorola figure 10-12. async bus arbitration ?idle bus case clko1 (output) as (output) d31?0 (output) a31?0 (output) br (input) bg (output) bclro (output) 47a 37 35 33 34 47a 61 60 47a 47a bgack (input)
electrical characteristics motorola mc68360 user? manual 10-23 figure 10-13. async bus arbitration ?active bus case clko1 (output) a31?0 (output) r/w (output) as (output) ds (output) d31?0 (output) dsack1 (i/o) br (input) bg (output) bgack (input) s0 s1 s2 s3 s4 33 16 7 s5 39a 34 35 37 dsack0 (i/o) bclro (output) 47a 47a 60 47a
electrical characteristics 10-24 mc68360 user? manual motorola figure 10-14. sync bus arbitration ?idle bus case clko1 (output) as (output) d31?0 (output) a31?0 (output) br (input) bg (output) bgack (input) 37 35 33 34 61 60 bclro (output) 64 65 63 62
electrical characteristics motorola mc68360 user? manual 10-25 figure 10-15. sync bus arbitration ?active bus case figure 10-16. configuration and clock mode select timing clko1 (output) a31?0 (output) r/w (output) as (output) ds (output) d31?0 (output) dsack1 (i/o) br (input) bg (output) bgack (input) s0 s1 s2 s3 s4 62 33 16 7 s5 39a 35 37 dsack0 (i/o) s98 bclro (output) 34 64 60 reseth config2?onfig0, 76 modck1?odck0, 16bm 75 77
electrical characteristics 10-26 mc68360 user? manual motorola figure 10-17. show cycle figure 10-18. background debug mode freeze timing as a31?0 clko1 s0 s42 s1 s41 s43 s2 s0 8 6 18 20 15 9 12 70 72 71 r/w ds d31?0 bkpt 27a (output) (output) (output) (output) (output) (input) show cycle start of external cycle freeze clko1 ifetch/dsi 86 88 87 89
electrical characteristics motorola mc68360 user? manual 10-27 figure 10-19. background debug mode serial port timing freeze clko1 82 83 80 81 84 85 bkpt/dsclk ifetch ipipe0/dso dsi 80
electrical characteristics 10-28 mc68360 user? manual motorola 10.10 bus operation?ram accesses ac timing specifications (the electrical specifications in this document are preliminary. see figure 10-20?igure 10-24.) notes: 1.this speci?ation is for wbtq=0, when wbtq=1 add another clock. num. characteristic 3.3 v or 5.0 v 5.0v unit 25.0 mhz 33.34mhz min max min max 100 ras? asserted to row address invalid 15 11.25 ns 101 ras? asserted to column address valid 20 15 ns 102 ras? width asserted 75 56.25 ns 103 1 ras? width negated (back to back cycles) 75 56.25 ns 104 ras? asserted to cas? asserted 35 26.25 ns 105 clko1 low to cas? asserted 3 13 2 10 ns 105a clko1 high to cas? asserted (refresh cycle) 3 13 2 10 ns 106 clko1 high to cas? negated 3 13 2 10 ns 107 column address valid to cas? asserted 15 11.25 ns 108 cas? asserted to column address negated 40 30 ns 109 cas? asserted to ras? negated 35 27 ns 110 cas? width asserted 50 37.5 ns 111 1 cas? width negated (back to back cycles) 95 71.25 ns 111a cas? width negated (page mode) 20 15 ns 113 we low to cas? asserted 35 27 ns 114 cas? asserted to we negated 35 27 ns 115 r/ w low to cas? asserted (write) 75 56.25 ns 116 cas? asserted to r/ w high (write) 55 41.25 ns 117 data-out, parity-out valid to cas? asserted 10 7.5 ns 119 clko1 high to amux negated 3 16 2 12 ns 120 clko1 high to amux asserted 3 16 2 12 ns 121 amux high to ras? asserted 15 11.25 ns 122 ras? asserted to amux low 15 11.25 ns 123 amux low to cas? asserted 15 11.25 ns 124 cas? asserted to amux high 55 41.25 ns 125 ras/cas? negated to r/w change 0 0 ns
electrical characteristics motorola mc68360 user? manual 10-29 figure 10-20. dram: normal read cycle (internal mux, trlx = 0) as a31?0 clko1 s0 s2 s4 s1 s3 s5 8 oe n ote: all timing is shown with respect 0.8-v and 2.0-v levels. rasx pa rity3?arity0 cas3?as0 106 109 11 102 103 s0 r/w 18 d31?0 27 21 29 s2 s1 s3 sw sw 105 104 9 6a 6 dsack1,0 d31?0 (output) (output) (output) (output) (output) (output) (output) (i/o) (input) (input) (input) 9 110 111 27b 101 100 107 108 12 pbee = 0 pbee = 1
electrical characteristics 10-30 mc68360 user? manual motorola figure 10-21. dram: normal write cycle r/w as a31?0 clko1 s0 s2 s4 s1 s3 s5 8 9 12 wex dsack1,0 20 17 d31?0 note: all timing is shown with respect to 0.8-v and 2.0-v levels. rasx parity0?arity3 cas3?as0 11 s0 6 6a 23 53 (output) (i/o) (output) (output) (output) (output) (output) (output) (output) (output) 108 106 102 105 114 110 113 115 116 117 100 101 107
electrical characteristics motorola mc68360 user? manual 10-31 figure 10-22. dram: refresh cycle figure 10-23. dram: page-mode?age-hit (output) (output) (output) (output) (output) a31?0 clko1 note: all timing is shown with respect to 0.8-v and 2.0-v levels. rasx not in page mode page mode rasx s4 s5 s0 s1 105a 106 12 12 12a cas3?as0 9 as a31?0 clko1 note: all timing is shown with respect to 0.8-v and 2.0-v levels. rasx amux internal mux (output) (output) (output) (output) (output) (output) s0 s2 s4 s1 s3 s5 8 9 108 100 105 107 106 11 s0 s4 s1 s5 s0 s1 107 105 6a 124 122 123 120 121 119 101 6a 111a internal mux external mux cas3?as0
electrical characteristics 10-32 mc68360 user? manual motorola figure 10-24. dram: page-mode?age-miss as a31?0 clko1 note: all timing is shown with respect to 0.8-v and 2.0-v levels. rasn amux internal mux (output) (output) (output) (output) (output) (output) s0 s2 s4 s1 s3 s5 s0 s1 s2 sw s3 sw 8 105 123 106 11 120 119 120 12a 6a 6a cas3?as0 9 external mux 122
electrical characteristics motorola mc68360 user? manual 10-33 10.11 030/quicc bus type slave mode bus arbitration ac electrical specifications (the electrical specifications in this document are preliminary. see figure 10-25 and figure 10-26) notes: 1. speci?ations are for asynchronous arbitration (astm=0). 2. speci?ations are for synchronous arbitration (astm=1). num. characteristic 3.3 v or 5.0 v 5.0v unit 25.0 mhz 33.34mhz min max min max 130 1 clko1 high to br asserted 20 15 ns 131 clko1 high to br high impedence 20 15 ns 132 1 bgack low to br high impedence 20 15 ns 133 clko1 high to bgack asserted 20 15 ns 134 2 as and bgack high (the latest one) to bgack low (when bg is asserted) 1.5 2.5 + 20 1.5 2.5 +15 clks ns 135 1,2 bg low to bgack low (no other bus master) 1.5 2.5 + 20 1.5 2.5 +15 clks ns 137 clock on which bgack low to clock on which as low. 0 0 clks 138 clko1 high to bgack high 20 15 ns 139 clko1 low to bgack high impedance 15 11.25 ns 140 bclri low to clko1 high 15 11.25 ns 141 bclri high to clko1 high 15 11.25 ns 142 3 bg low to clko1 low 15 11.25 ns 143 3 as and bgack high (the latest one) to bgack low (when bg is asserted) 11 + 20 11 +15 clks ns 144 1,3 bg low to bgack low (no other bus master) 1 1 + 20 11 +15 clks ns
electrical characteristics 10-34 mc68360 user? manual motorola figure 10-25. mc68360 slave mode asynchronous arbitration s0 s1 s2 s3 s4 s5 (output) br (input) bg bgack (i/o) (output) as 47a 139 138 137 134 135 130 clko1 136 132 131 (output) bclro 60 61 bclri (input) 140 note: diagram does not apply to mc68040 companion mode. 141 133
electrical characteristics motorola mc68360 user? manual 10-35 figure 10-26. mc68360 slave mode synchronous arbitration s0 s1 s2 s3 sw sw (output) br (input) bg bgack (i/o) (output) as 137 142 clko1 (output) bclro bclri 140 (input) note: diagram does not apply to mc68040 companion mode. 132 s4 s5 61 131 60 130 136 136 138 139 144 141 143
electrical characteristics 10-36 mc68360 user? manual motorola 10.12 030/quicc bus type slave mode internal read/write/ iack asynchronous cycles ac electrical specifications (the electrical specifications in this document are preliminary. see figure 10-27 and figure 10-28) notes: 1asynchronous specifications above are valid only when bstm=0. 2. for external bus master to external memory or peripheral. 3. for external bus master to internal memory or registers. num. characteristic 3.3 v or 5.0 v 5.0v unit 25.0 mhz 33.34mhz min max min max 150 address valid to as low 10 8 ns 151 as valid to ds low 0 0 ns 152 as inactive time 1 1 clk 153 as high to address hold time 0 0 ns 154 ds inactive to as inactive 0 0 ns 155 ds inactive time 1 1 clk 156 dsack low to as , ds high 0 0 ns 157 data out valid to dsack low 15 11.25 ns 158 clko1 low to data-out valid 20 15 ns 159 ds high to data-out hold time 0 0 ns 160 ds high to data high impedance 40 30 ns 161 clko1 high to dsack low (note 2) 20 15 ns 161a clko1 high to dsack low (note 3) 25 ns 162 as high to dsack high 20 15 ns 163 dsack high to dsack high impedance 15 11.25 ns 164 r/ w valid to ds low 0 0 ns 165 ds high to r/ w high 0 0 ns 166 data-in, mbare valid to ds low 20 15 ns 167 dsack low to data-in, mbare hold time 0 0 ns 169 clko1 low to aveco low 20 15 ns 170 as high to aveco high impedance 30 23 ns 171 clko1 low to iack low 20 15 ns 172 as high to iack high 30 23 ns
electrical characteristics motorola mc68360 user? manual 10-37 figure 10-27. external mc68030/mc68360 internal asynchronous read cycle timing diagram external 030/quicc internal asynchronous read cycle timing diagram clko1 (output) a31?0 (input) d31?0 (output) (input) as (input) r/w (output) dsack1,0 (input) ds s0 s1 s2 s3 s4 s5 s0 sw sw sw sw sw sw sw sw 153 154 152 150 155 160 159 158 47a 157 151 162 163 156 47a 161
electrical characteristics 10-38 mc68360 user? manual motorola figure 10-28. external mc68030/mc68360 internal registers asynchronous write cycle timing diagram clko1 (output) a31?0 (input) d31?0 (input) (input) as (input) r/w (output) dsack1,0 (input) ds (input) mbare s0 s1 s2 s3 s4 s5 s0 sw sw sw sw sw sw 153 154 152 150 155 156 167 161 162 47a sw sw 163 47a 151 166 164 165
electrical characteristics motorola mc68360 user? manual 10-39 10.13 030/quicc bus type slave mode internal read/write/ iack synchronous cycles ac electrical specifications (the electrical specifications in this document are preliminary. see figures 10-29?0-32.) notes: 1synchronous speci?ations above are valid only when bstm=1. num. characteristic 3.3 v or 5.0 v 5.0v unit 25.0 mhz 33.34mhz min max min max 180 as low to clko1 high 7 6 ns 181 clko1 low to as high 20 15 ns 182 ds low to clko1 high 7 6 ns 183 clko1 low to ds high 20 15 ns 184 clko1 low to data-out valid 20 15 ns 185 r/ w low to clko1 high 7 6 ns 186 clko1 high to r/ w high 20 15 ns 187 data-in, mbare valid to ds low 2 2 ns 188 clko1 low to data-in, mbare hold time 10 7.5 ns 191 as low to aveco low 30 23 ns 192 as low to iack low 30 23 ns
electrical characteristics 10-40 mc68360 user? manual motorola figure 10-29. external mc68030/mc68360 asynchronous iack cycle timing diagram clko1 (output) a31?0 (input) d31?0 (output) (input) as (input) r/w 152 150 155 47a (output) dsack1,0 (input) ds 153 154 156 160 158 161 157 47a 151 s0 s1 s2 s3 s4 s5 s0 sw sw sw sw sw sw sw sw sw sw sw sw 170 169 (output) aveco 171 (output) iackx 163 172 162 159
electrical characteristics motorola mc68360 user? manual 10-41 figure 10-30. external mc68030/mc68360 internal synchronous read cycle timing diagram note: two wait states are inserted when reading the sim, dual-port ram, and cpm. three wait states are inserted when reading the si ram. additional wait states may be inserted when the shen1?hen0 =10 and one of the internal masters is accessing an internal peripheral. s0 s1 s2 s3 s4 s5 s0 sw sw sw sw clko1 (output) a31?0 (input) d31?0 (output) (input) as (input) r/w 152 150 155 (output) dsack1,0 (input) ds 182 161 181 183 184 159 160 153 162 163 180 2 or 3 clocks
electrical characteristics 10-42 mc68360 user? manual motorola figure 10-31. external mc68030/mc68360 internal synchronous write cycle timing diagram note this figure represents an iack cycle for both vectored and au- tovectored interrupt. if iack is for a vectored interrupt, aveco will not be driven. if iack is an autovector interrupt, dsack0-1 and data bus will not be driven. a31?0 (input) d31?0 (input) (input) as (input) r/w (input) ds clko1 (output) (output) dsack1,0 note: two wait states are inserted when writing to the sim. three wait states are inserted when writing to the dual- port ram and cpm. four wait states are inserted when writing the si ram. additional wait states may be inserted when the shen1?hen0 = 10 and one of the internal masters is accessing an internal peripheral. (input) mbare 155 185 s0 s1 s2 s3 s4 s5 s0 sw sw sw sw 2? clocks 152 150 180 181 153 161 163 183 186 188 187 162 182
electrical characteristics motorola mc68360 user? manual 10-43 figure 10-32. external mc68030/mc68360 synchronous iack cycle timing diagram s0 s1 s2 s3 s4 s5 s0 sw sw sw sw clko1 (output) a31?0 (input) d31?0 (output) (input) as (input) r/w 152 150 155 (output) dsack1,0 (input) ds 180 182 161 184 159 162 153 sw sw sw sw 170 (output) iackx 191 172 (output) aveco 181 183 160 160 192
electrical characteristics 10-44 mc68360 user? manual motorola 10.14 030/quicc bus type sram/dram cycles ac electrical specifications (the electrical specifications in this document are preliminary. see figure 10-33?igure 10-37) notes: 1synchronous speci?ations above are valid only when bstm=1. num. characteristic 3.3 v or 5.0 v 5.0v unit 25.0 mhz 33.34mhz min max min max 200 as low to oe low (read cycle) 20 15 ns 201 as high to oe high 20 15 ns 202 as low to we low (write cycle) 20 15 ns 203 as high to we high 20 15 ns 204 clko1 high to dsack high 20 15 ns 205 as low to cs? low 22 ns 206 as high to cs? high 20 15 ns 207 as low to dsack low 27 22 ns 208 as high to cas? high 20 15 ns 210 as low to bkpto low 25 23 ns 211 as high to bkpto high 30 25 ns 212 data valid to prty3? valid 20 15 ns 213 data invalid to prty3? invalid 5 3.75 ns 214 r/ w valid to as low 0 0 ns 215 as high to r/ w invalid 0 0 ns 216 as assert to parity driven 4 3 ns 217 as negate to parity invalid 4 20 15 ns
electrical characteristics motorola mc68360 user? manual 10-45 figure 10-33. external mc68030/mc68360 sram asynchronous cycle timing diagram (bstn = 0/1; sync = 0) (write cycle output) s0 s1 s2 s3 s4 s5 s0 sw sw sw sw clko1 (output) a31?0 (input) (input) as (input) r/w 152 150 153 (output) csx 205 206 (output) dsack1,0 161 162 163 200 201 207 (read cycle output) oe 202 203 164 165 bkpto (output) 210 211 we
electrical characteristics 10-46 mc68360 user? manual motorola figure 10-34. external mc68030/mc68360 sram synchronous cycle timing diagram (bstm = 1; sync = 1) s0 s1 s2 s3 s4 s5 s0 sw sw sw sw clko1 (output) a31?0 (input) as (input) r/w (input) 152 150 csx (output) 180 dsack1,0 (output) 161 163 oe (read cycle output) 200 we (write cycle output) 202 185 204 201 203 186 153 12 9 161 12a csntq = 1 csntq = 0 181 210 211 bkpto (output)
electrical characteristics motorola mc68360 user? manual 10-47 figure 10-35. external mc68030/mc68360 dram asynchronous cycle timing diagram (bstm = 0; sync = 0) clko1 (output) a31?0 (input) (input) as (input) r/w (output) dsack1,0 (write cycle output) we rasx amux s0 s1 s2 s3 s4 s5 s0 sw sw sw sw 152 150 47a 161 162 202 164 9 105 208 120 153 203 165 12 209 (output) (output) (output) 163 cas3?as0
electrical characteristics 10-48 mc68360 user? manual motorola figure 10-36. external mc68030/mc68360 dram synchronous cycle timing diagram (bstm = 1; sync = 1) figure 10-37. external mc68030/mc68360 parity bits timing diagram s0 s1 s2 s3 s4 s5 s0 sw sw clko1 (output) a31?0 (input) as (input) r/w (input) dsack1,0 (output) we (write cycle output) rasx cas3?as0 amux 120 152 150 180 161 204 202 185 106 153 203 186 12 119 (output) (output) (output) 9 105 163 d31?0 (input) prty3?rty0 (output) 212 213
electrical characteristics motorola mc68360 user? manual 10-49 figure 10-38. external mc68030/mc68360 parity bits timing diagram 10.15 040 bus type slave mode bus arbitration ac electrical specifications (the electrical specifications in this document are preliminary. see figure 10-39) notes: 1. bg remains low until either the sdma or the idma requests the external bus. num. characteristic 3.3 v or 5.0 v 5.0v unit 25.0 mhz 33.34mhz min max min max 231 address, transfer attributes high impedance to clock high 7 6 ns 232 1 clock high to bg low 20 15 ns 233 clock high to bg high 4 20 4 15 ns 234 bb high to clock high (040 output) 7 6 ns 235 bb high impedance to clock high (040 output) 0 0 ns 236 clock high to bb low (360 output) 20 15 ns 237 clock high to bb high (360 output) 20 15 ns 238 clock low to bb high impedance (360 output) 20 15 ns clko1 (output) a31?0 (input) (input) as (output) dsack1,0 d31?0 (input) perr (output) s0 s1 s2 s3 s4 s5 s0 sw sw sw sw 30 27 90 s0 cpu clearspern bit 91 p rty3?rty0 (input)
electrical characteristics 10-50 mc68360 user? manual motorola figure 10-39. mc68040 companion mode arbitration (output) bclro bg (output) bb (i/o) a31?0 (i/o) clko1 transfer attributes (input) notes: 1. mc68040 transfer attribute signals = sizx, ttx, tmx, r/w, lock. 2. bg always remains asserted until either the sdma or the idma requests the external bus. (output) (input) bclri s0 s1 s2 s3 s4 s5 c2 c1 238 040 bus master 360 bus master 60 61 237 234 231 233 232 235 140 141 236
electrical characteristics motorola mc68360 user? manual 10-51 10.16 040 bus type slave mode internal read/write/iack cycles ac electrical specifications (the electrical specifications in this document are preliminary . see figure 10-40?igure 10-42) notes: 1.transfer attributes signals = sizx, ttx, tmx, r/ w , and lock . 2.when mc68040 is accessing the internal registers, specification 258 is from clock low not clock high. num. characteristic 3.3 v or 5.0 v 5.0v unit 25.0 mhz 33.34mhz min max min max 251 1 address, transfer attributes valid to clock low 15 11.25 ns 252 ts low to clock high 7 6 ns 253 clock high to ts high 5 3 ns 254 clock high to address, transfer attributes invalid 0 0 ns 255 data-in, mbare valid to clock high (040 write) 0 0 ns 256 clock high to data-in, mbare hold time 0 0 ns 257 clock high to ta , tbi low (external to external) 4 20 4 15 ns 257 clock high to ta , tbi low (external to internal) 4 23 4 18 ns 258 2 clock high to ta , tbi high 4 20 4 15 ns 259 ta , tbi high to ta , tbi high impedance 15 11.25 ns 260 clock low to data-out valid (040 read) 20 15 ns 262 clock low to data-out invalid 20 15 ns 263 clock low to data-out high impedance 15 ns 264 clock high to aveco low 20 15 ns 265 clock lowto aveco high impedance 30 23 ns 266 clock low to iack low 30 23 ns 267 clock high to iack high 30 23 ns 268 clock low to avec low 30 23 ns
electrical characteristics 10-52 mc68360 user? manual motorola figure 10-40. mc68040 internal registers read cycles clko1 ts (input) a31?0 (input) transfer attributes (input) c1 c2 cw cw ta (output) d31?0 (040 write) tbi (output) 3? clocks notes: 1. three wait states are inserted when reading the sim, dual-port ram, and the cpm. four wait states are inserted masters is accessing an internal peripheral. (output) 2. mc68040 transfer attribute signals = sizx, ttx, tmx, r/w, lock 252 253 251 254 263 258 257 cw cw 260 when reading the si ram. additional wait states may be inserted when the shen1- shen0=10 and one of the internal c1 259 (input)
electrical characteristics motorola mc68360 user? manual 10-53 figure 10-41. mc68040 internal registers write cycles clko1 ts a31?0 transfer attributes (input) ta d31?0 (040 write) mbare tbi 2? clocks notes: 1. two wait states are inserted when writing to the sim. three wait states are inserted when writing to the dual-port ram and cpm. four wait states are inserted when writing to the si ram. additional wait states may be inserted when the shen1- ?shen0=10 and one of the internal masters is accessing an internal peripheral. (output) (input) 2. mc68040 transfer attribute signals = sizx, ttx, tmx, r/w, lock 252 253 251 255 255 254 258 257 c1 c2 cw cw cw c1 (input) (input) (input) (output) (output) 256 256 259
electrical characteristics 10-54 mc68360 user? manual motorola figure 10-42. mc68040 iack cycles (vector driven) clko1 253 ts a31?0 (input) transfer attributes c1 c2 cw cw cw ta d31?0 tbi cw cw 266 iack7-1 2. up to two wait states may be inserted for internal arbitration. 0? clocks (output) (output) notes: 1. mc68040 transfer attribute signals = sizx, ttx, tmx, r/w, lock. 252 254 263 262 258 257 260 267 251 (input) (input) (output) (output) (output) 259
electrical characteristics motorola mc68360 user? manual 10-55 figure 10-43. mc68040 iack cycles (no vector driven) clko1 253 ts (input) a31?0 (input) transfer attributes (input) c1 c2 cw cw ta (input) tbi (output) 266 iack7-1 (output) (output) notes: 1. mc68040 transfer attribute signals = sizx, ttx, tmx, r/w, lock. 252 254 290 267 251 289 257 250 aveco (output) 264 265
electrical characteristics 10-56 mc68360 user? manual motorola 10.17 040 bus type sram/dram cycles ac electrical specifications (the electrical specifications in this document are preliminary . see figure 10-44?igure 10-48) notes: 1.transfer attributes signals = sizx, ttx, tmx, r/w , and lock . 2.tea/t a should not be asserted on a dram burst access, or on the same clock or before rasx / csx is asserted num. characteristic 3.3 v or 5.0 v 5.0v unit 25.0 mhz 33.34mhz min max min max 280 address valid to badd2? valid 20 15 ns 280a badd2? valid to cas assertion 15 10 ns 281 address invalid to badd2? invalid 0 0 ns 282 clock high to cs?/ras? low (tss40=0) 4 16 4 12 ns 283 clock high to cs?/ras? high (csnt40=0) 4 16 4 12 ns 284 clock high to brk low 20 15 ns 284a clock low to brk low 20 15 ns 285 clock high to brk high 20 15 ns 286 clock low to cs? /rasx low (tss40=1) 4 16 4 12 ns 287 clock low to cs? /rasx high (csnt40=1) 4 16 4 12 ns 288 1 addresstransfer attributes valid to clock high (tss40=0) 12 11 ns 289 2 ta low to clock high (external termination) 11 9 ns 290 2 clock high to ta high (external termination) 20 15 ns 291 clock high to oe low (read cycles) 20 15 ns 292 clock high to oe high (read cycles) 20 15 ns 293 clock high to we low (write cycles) 20 15 ns 294 clock high to we high (write cycles) 20 15 ns 295 clock high to cas? low 4 13 4 10 ns 295a clock high to cas? high (040 burst read only) 4 13 4 10 ns 296 clock high to cas? high 4 13 4 10 ns 297 clock low to amux low 3 16 3 12 ns 298 clock high to amux high 3 16 3 12 ns 299 clock high to badd2? valid (040 burst cycles) 4 20 4 15 ns 300 2 tea low to clock high 11 ns 301 2 clock high to tea high 2 20 2 15 ns 302 data, parity valid to clock high (data, parity set- up) 7 6 ns 303 clock high to data, parity invalid (data, parity hold) 7 5 ns 305 clko1 high (after ts low) to parity valid 20 15 ns 306 clko1 high (after ta low) to parity hi-z 4 20 15 ns
electrical characteristics motorola mc68360 user? manual 10-57 figure 10-44. mc68040 sram read/write cycles (tss40 =0, csnt40 = 0) clko1 (output) ts (input) a31?0 (input) transfer attributes (input) c1 c2 ta (output) tbi (output) csx (output) badd3- badd2 (output) bkpto (output) oe (output) (read cycles) we (output) note: mc68040 transfer attribute signals = sizx, ttx, tmx, r/w, lock tea (input) 288 254 281 253 280 282 258 257 284 285 292 291 293 294 301 252 283 300 259 (write cycles)
electrical characteristics 10-58 mc68360 user? manual motorola figure 10-45. mc68040 sram read/write cycles (tss40 =1, csnt40 = 1) c1 c2 clko1 (output) ts (input) a31?0 (input) transfer attributes (input) badd3- badd2 (output) c3 bkpto (output) tea (input) csn (output) ta (input) 251 280 252 253 254 281 289 290 300 301 285 284a tbi (output) 258 ta (output) 257 286 287 note: mc68040 transfer attribute signals = sizx, ttx, tmx, r/w, lock 259
electrical characteristics motorola mc68360 user? manual 10-59 figure 10-46. external mc68040 dram cycles timing diagram c1 c2 cw clko1 (output) we (write cycle output) cas3- cas0 amux ts (input) a31?0 (input) transfer attributes (input) rasx (output) badd3- badd2 (output) c1 ta (output) tbi (output) (output) (output) tea (input) 288 280 252 253 282 121 298 122 123 295 254 281 283 296 298 294 293 297 259 258 257 300 301
electrical characteristics 10-60 mc68360 user? manual motorola figure 10-47. external mc68040 dram burst cycles timing diagram c1 c2 cw clko1 (output) we (write cycle output) cas3- cas0 amux ts (input) a31?0 (input) transfer attributes (input) rasx (output) badd3- badd2 (output) c1 ta (output) tbi (output) c2 (output) (output) 299 299 288 280 252 253 282 295 296 295 296 297 293 257 258 257 258 295a
electrical characteristics motorola mc68360 user? manual 10-61 figure 10-48. external mc68040 parity bit checking timing diagram (a) generation timing diagram 213 212 d31?0 (input) prty3? prty0 (output) (b) checking timing diagram clko1 (output) ts (input) a31?0 (input) transfer attributes (input) c1 c2 ta (output) badd3- badd2 (output) perr (output) cpu clears pern bit c1 d31?0, (input) 302 303 90 91 prty3? prty0 (input) 305 306
electrical characteristics 10-62 mc68360 user? manual motorola 10.18 idma ac electrical specifications (the electrical specifications in this document are preliminary. see figure 10-49 and figure 10-50.) notes: 1.these speci?ations are for asynchronous mode. 2.these speci?ations are for synchronous mode. num. characteristic 3.3 v or 5.0 v 5.0v unit 25.0 mhz 33.34mhz min max min max 1 clko1 low to dack , done asserted 24 18 ns 2 clko1 low to dack , done negated 24 18 ns 3 1 dreq? asserted to as asserted (for dma bus cycle) 3t cyc + t aist + t clsa 4 1 asynchronous input setup time to clko1 low 12 9 ns 5 1 asynchronous input hold time from clko1 low 0 0 ns 6 as to dack assertion skew 0 20 0 15 ns 7 dack to done assertion skew ? 8 -6 6 ns 8 as , dack , done width asserted 70 52.5 ns 8a as , dack , done width asserted (fast termina- tion cycle) 28 20.5 ns 10 1 asynchronous input setup time to clko1 low 5 4 ns 11 1 asynchronous input hold time from clko1 low 10 7.5 ns 12 2 dreq input setup time to clko1 low 20 15 ns 13 2 dreq input hold time from clko1 low 5 3.75 ns 14 2 done input setup time to clko1 low 20 15 ns 15 2 done input hold time from clko1 low 5 3.75 ns 16 2 dreq asserted to as asserted 2 2 clk
electrical characteristics motorola mc68360 user? manual 10-63 figure 10-49. idma signal asynchronous timing diagram figure 10-50. idma signal synchronous timing diagram as clko1 dreq 41 8 2 1 6 3 7 1 dack done (output) done (input) s0 s2 s4 s0 s2 s4 s1 s3 s5 s1 s3 s5 cpu_cycle (idma request) idma_cycle 10 5 11 (output) (input) (output) (output) as clko1 dreq 12 1 8 2 1 6 16 7 1 dack done (output) done (input) s0 s2 s4 s0 s2 s4 s1 s3 s5 s1 s3 s5 cpu_cycle (idma request) idma_cycle 14 13 15 (output) (input) (output) (output)
electrical characteristics 10-64 mc68360 user? manual motorola 10.19 pip/pio ac electrical specifications (the electrical specifications in this document are preliminary. see figure 10-51?figure 10-55) note: t3 = spec. 3 on table 10.7 figure 10-51. pip rx (interlock mode) num. characteristic 3.3 v or 5.0 v 5.0 v unit 25.0 mhz 33.3 mhz min max min max 21 data-in setup time to stbi low 0?ns 22 data-in hold time to stbi high 2.5?t3 2.5?t3 clk 23 stbi pulse width 1.5 1.5 clk 24 stbo pulse width 1 clko1 - 5ns 1 clko1 - 5ns ? 25 data-out setup time to stbo low 2?clk 26 data-out hold time from stbo high 5?clk 27 stbi low to stbo low (rx interlock) ??clk 28 stbi low to stbo high (tx interlock) 2?clk 29 data-in setup time to clock low 20 15 ns 30 data-in hold time from clock low 10 7.5 ns clock high to data-out valid (cpu writes data, control, or direction) ?5?5ns data out strbo strbi (input) (output) 25 28 26 23
electrical characteristics motorola mc68360 user? manual 10-65 figure 10-52. pip tx (interlock mode) figure 10-53. pip tx (pulse mode) data in strbi strbo (input) (output) 21 23 22 24 data in stbi stbo (input) (output) 21 23 22 24
electrical characteristics 10-66 mc68360 user? manual motorola figure 10-54. pip tx (pulse mode) figure 10-55. parallel i/o data-in/data-out timing diagram 10.20 interrupt controller ac electrical specifications (the electrical specifications in this document are preliminary . see figure 10-56 and figure 10-57) num. characteristic 3.3 v or 5.0 v 5.0 v unit 25.0 mhz 33.34 mhz min max min max 35 port c interrupt pulse width low (edge triggered mode) 70?5 ns 36 minimum time between active edges portc 70 55 clk 37 clock high to iout valid (slave mode) 20 17 ns 38 clock high to rqout valid (slave mode) 20 17 ns data out stbo stbi (input) (output) 25 24 26 23 data out data in 30 cpu write s4 31 clko1 (output) 29
electrical characteristics motorola mc68360 user? manual 10-67 figure 10-56. interrupts timing diagram figure 10-57. slave mode: interrupts timing diagram 10.21 baud rate generator ac electrical specifications (the electrical specifications in this document are preliminary . see figure 10-58) figure 10-58. baud rate generator output signals num. characteristic 3.3 v or 5.0 v 5.0 v unit 25.0 mhz 33.34 mhz min max min max 50 brgo rise and fall time 10 7.5 ns 51 brgo duty cycle 40 60 40 60 % 52 brgo cycle 40 30 ns port c (input) 35 36 iout2- iout0 clko1 rqout (output) (output) (output) 37 38 50 51 51 brgox 52 50
electrical characteristics 10-68 mc68360 user? manual motorola figure 10-59. cpm general purpose timers 10.22 timer electrical specifications the electrical specifications in this document are preliminary. see figure 10-59) num. characteristic symbol 3.3 v or 5.0 v 5.0 v unit 25 mhz 33.34mhz min max min max 61 tin/ tgate rise and fall time t rf 10?0ns 62 tin/ tgate low time 1 1 clk 63 tin/ tgate high time 2 2 clk 64 tin/ tgate cycle time 3 3 clk 65 clko1 high to tout valid t to 325322ns 62 65 63 64 61 61 60 clko1 (output) tin/tgate (input) tout (output)
electrical characteristics motorola mc68360 user? manual 10-69 10.23 si electrical specifications (the electrical specifications in this document are preliminary. see figure 10-60?igure 10-64.) notes: 1. the ratio syncclk/l1rclk must be greater than 2.5/1 2. where p=1/clko1. thus for a 25 mhz clko1 rate, p=40ns. 3. these specs are valid for idl mode only 4. the strobes and txd on the ?st bit of the frame become valid after l1clk edge or l1sync, whichever is later. num. characteristic 3.3 v or 5.0 v 5.0 v unit 25.0 mhz 33.34 mhz min max min max 70 1,3 l1rclk, l1tclk fequency (dsc=0) 10 10 mhz 71 3 l1rclk, l1tclk width low(dsc=0) p+10 p+10 ns 71a 2 l1rclk, l1tclk width high (dsc=0) p+10 p+10 ns 72 l1txd, l1st(1?), l1rq, l1clko rise/fall time ?5?5 ns 73 l1rsync, l1tsync valid to l1clk edge (sync setup time) 20?0 ns 74 l1clk edge to l1rsync, l1tsync invalid (sync hold time) 35?5 ns 75 l1rsync, l1tsync rise/fall time 15 15 ns 76 l1rxd valid to l1clk edge (l1rxd setup time) 42?2 ns 77 l1clk edge to l1rxd invalid (l1rxd hold time) 35?5 ns 78 l1clk edge to l1st(1?) valid 10 45 10 45 ns 78a 4 l1sync valid to l1st(1?) valid 10 45 10 45 ns 79 l1clk edge to l1st(1?) invalid 10 45 10 45 ns 80 l1clk edge to l1txd valid 10 65 10 65 ns 80a 4 l1tsync valid to l1txd valid 10 65 10 65 ns 81 l1clk edge to l1txd high impedance 0 42 0 42 ns 82 l1rclk, l1tclk fequency (dsc=1) 12.5 16 mhz 83 l1rclk, l1tclk width low(dsc=1) p+10 p+10 ns 83a 2 l1rclk, l1tclk width high (dsc=1) p+10 p+10 ns 84 l1clk edge to l1clko valid (dsc=1) 30 30 ns 85 3 l1rq valid before falling edge of l1tsync 1? l1tclk 86 3 l1gr setup time 42 42 ns 87 3 l1gr hold time 42 42 ns 88 l1clk edge to l1sync valid (fsd = 00, cnt = 0000, byt = 0, dsc=0) ?? ns
electrical characteristics 10-70 mc68360 user? manual motorola figure 10-60. si receive timing with normal clocking (dsc = 0) l1rsync (input) 71 l1st (4-1) (output) rfcd = 1 70 73 74 75 l1rxd (input) 78 76 bit0 l1rclk (fe =1,ce = 1) (input) 72 l1rclk (fe = 0,ce = 0) (input) 77 79
electrical characteristics motorola mc68360 user? manual 10-71 figure 10-61. si receive timing with double speed clocking (dsc = 1) l1rsync (input) l1st (4-1) (output) 79 rfcd = 1 73 74 75 l1rxd (input) 77 76 bit0 l1rclk (fe = 1, ce = 1) (input) l1rclk (fe = 0, ce = 0) (input) 82 72 83a l1clko ( output) 84 78
electrical characteristics 10-72 mc68360 user? manual motorola figure 10-62. si transmit timing with normal clocking (dsc = 0) l1txd (input) bit0 81 l1tsync (output) 71 l1st (4-1) (output) 78 79 tfcd = 0 70 73 74 75 l1tclk (fe = 1, ce = 1) (input) 72 l1tclk (fe = 0, ce = 0) (input) 80a 80 78a
electrical characteristics motorola mc68360 user? manual 10-73 figure 10-63. si transmit timing with double speed clocking (dsc = 1) l1txd ( output) bit0 81 l1tsync (input) l 1st (1-4) ( output) 78 79 tfcd = 0 73 74 75 80a 80 78a l1rclk (fe = 1, ce = 1) (input) l1rclk (fe = 0, ce = 0) (input) 82 72 83a l1clko ( output) 84
electrical characteristics 10-74 mc68360 user? manual motorola figure 10-64. idl timing d1 b10 b11 a b27 b26 b25 b24 b23 b22 b21 b20 d2 m b17 b15 b14 b12 b13 b16 (output) l1rclk (input) l1rxd (input) l1rsync (input) l1st (4-1) (output) l1txd l1rq (output) l1gr (input) 6 8 10 11 12 13 16 17 18 12 3 4 5 7 9 14 15 19 20 d1 b10 b11 a b27 b26 b25 b24 b23 b22 b21 b20 d2 m b17 b15 b14 b12 b13 b16 74 73 71 71 80 76 77 78 72 85 86 87 81
electrical characteristics motorola mc68360 user? manual 10-75 10.24 scc in nmsi mode?xternal clock electrical specifications (the electrical specifications in this document are preliminary. see figure 10-65?igure 10-67) notes: 1.the ratio syncclk/rclk1 and syncclk/tclk1 must be greater or equal to 2.25/1 2.also applies to cd and cts hold time when they are used as an external sync signals. 10.25 scc in nmsi mode?nternal clock electrical specifications (the electrical specifications in this document are preliminary. see figure 10-65?igure 10-67) notes: 1.the ratio syncclk/rclk1 and syncclk/tclk1 must be greater or equal to 3/1 2.also applies to cd and cts hold time when they are used as an external sync signals. num. characteristic 3.3 v or 5.0 v 5.0 v unit 25.0 mhz 33.34 mhz min max min max 100 1 rclk1 and tclk1 width high clko1 clko1 101 rclk1 and tclk1 width low clko1 + 5ns clko1 + 5ns 102 rclk1 and tclk1 rise/fall time 15 15 ns 103 txd1 active delay (from tclk1 falling edge) 0 50 0 50 ns 104 rts1 active/inactive delay (from tclk1 falling edge ) 050050ns 105 cts1 setup time to tclk1 rising edge 5?ns 106 rxd1 setup time to rclk1 rising edge 5?ns 107 2 rxd1 hold time from rclk1 rising edge 5?ns 108 cd1 setup time to rclk1 rising edge 5?ns num. characteristic 3.3 v or 5.0 v 5.0 v unit 25.0 mhz 33.34 mhz min max min max 100 1 rclk1 and tclk1 frequency 0 8.3 0 11 mhz 102 rclk1 and tclk1 rise/fall time ns 103 txd1 active delay (from tclk1 falling edge) 0 30 0 30 ns 104 rts1 active/inactive delay (from tclk1 falling edge ) 03040 ns 105 cts1 setup time to tclk1 rising edge 40 40 ns 106 rxd1 setup time to rclk1 rising edge 40 0 ns 107 2 rxd1 hold time from rclk1 rising edge 0 40 ns 108 cd1 setup time to rclk1 rising edge 40 0 30 ns
electrical characteristics 10-76 mc68360 user? manual motorola figure 10-65. scc nmsi receive figure 10-66. scc nmsi transmit rxd1 (inpu t) rclk1 108 107 106 102 102 100 101 cd1 (inpu t) 107 cd1 (sync - inpu t) txd1 (outpu t) tclk1 102 cts1 (inpu t) rts1 (outpu t) 104 cts1 (syn c- inpu t) 102 101 100 103 104 105 107
electrical characteristics motorola mc68360 user? manual 10-77 figure 10-67. hdlc bus timing 10.26 ethernet electrical specifications (the electrical specifications in this document are preliminary. see figure 10-68?igure 10-73) num. characteristic 3.3 v or 5.0 v 5.0 v unit 25.0 mhz 33.34 mhz min max min max 120 clsn width high 40 40 ns 121 rclk1 rise/fall time 15 15 ns 122 rclk1 width low clko1+ 5ns clko1+ 5ns 123 1 rclk1 width high clko1 clko1 124 rxd1 setup time 20 20 ns 125 rxd1 hold time 5?ns 126 rena active delay (from rclk1 rising edge of the last data bit) 10?0ns 127 rena width low 100 100 ns 128 tclk1 rise/fall time 15 15 ns 129 tclk1 width low clko1+ 5ns clko1+ 5ns 130 1 tclk1 width high clko1 clko1 131 txd1 active delay (from tclk1 rising edge) 10 50 10 50 ns 132 txd1 inactive delay (from tclk1 rising edge) 10 50 10 50 ns 133 tena active delay (from tclk1 rising edge) 10 50 10 50 ns 134 tena inactive delay (from tclk1 rising edge) 10 50 10 50 ns 135 rstrt active delay (from tclk1 falling edge) 10 50 10 50 ns 136 rstrt inactive delay (from tclk1 falling edge) 10 50 10 50 ns 137 rrjct width low 1? clko1 txd1 (o utput) tclk1 104 100 101 102 102 105 rts1 (o utput) 104 cts1 (echo input) 103 107
electrical characteristics 10-78 mc68360 user? manual motorola notes: 1the ratio syncclk/rclk1 and syncclk/tclk1 must be greater or equal to 2.25/1 2sdack is asserted whenever the sdma writes the incoming frame da into memory. figure 10-68. ethernet collision timing figure 10-69. ethernet receive timing 138 2 clko1 low to sdack asserted 20 20 ns 139 2 clko1 low to sdack negated 20 20 ns clsn (cts1) (input) 120 rxd1 (input) rclk1 125 124 121 123 122 rena (cd1) (input) last bit 127 126 121
electrical characteristics motorola mc68360 user? manual 10-79 figure 10-70. ethernet transmit timing figure 10-71. cam interface receive start timing txd1 (output) tclk1 (note 1) 132 131 128 128 130 129 tena (rts1) (output) rena (cd1) (input) (note 2) 1. transmit clock invert (tci) bit in gsmr is set. 2. if rena is deasserted before tena, or rena is not asserted at all during transit, then csl bit is set in the buffer descriptor at the end of frame transmission. 133 134 notes: rxd1 (input) rclk1 rstrt (output) 0 1 1 start frame delimiter bit # 1 bit # 2 note: valid for the ethernet protocol only. 135 136
electrical characteristics 10-80 mc68360 user? manual motorola figure 10-72. cam interface reject timing figure 10-73. sdack timing diagram 10.27 smc transparent mode electrical specifications (the electrical specifications in this document are preliminary. see figure 10-74) notes: 1.the ratio syncclk/smclk must be greater or equal to 2/1 num. characteristic 3.3 v or 5.0 v 5.0 v unit 25.0 mhz 33.34 mhz min max min max 150 1 smclk clock period 100 100 ns 151 smclk width low 50 50 ns 151a smclk width high 50 50 ns 152 smclk rise/fall time 15 15 ns 153 smtxd active delay (from smclk falling edge) 10 50 10 50 ns 154 smrxd/sync1 setup time 20 20 ns 155 smrxd/sync1 hold time 5? ns rrjct (input) 137 note: valid for the ethernet protocol only. as clko1 138 sdackx s0 s2 s4 s1 s3 s5 sdma cycle (output) (output) (output) note: sdackx is asserted when the sdma writes the received ethernet frame into memory. 139
electrical characteristics motorola mc68360 user? manual 10-81 figure 10-74. smc transparent rxd1 (input) 155 154 txd1 (output) 153 150 151 152 152 sync1 154 155 note 1 note 1: this delay is equal to an integer number of "character length" clocks smclk 151a
electrical characteristics 10-82 mc68360 user? manual motorola 10.28 spi master electrical specifications (the electrical specifications in this document are preliminary. see figure 10-75 and figure 10-76) figure 10-75. spi master (cp = 0) figure 10-76. spi master (cp = 1) num. characteristic 3.3 v or 5.0 v 5.0 v unit 25.0 mhz 33.34 mhz min max min max 160 master cycle time 4 1024 4 1024 tcyc 161 master clock (spiclk) high or low time 2 512 2 512 tcyc 162 master data setup time (inputs) 50 50 ns 163 master data hold time (inputs) 0?ns 164 master data valid (after spiclk edge) 20 20 ns 165 master data hold time (outputs) 0?ns 166 rise time: output 15 15 s 167 fall time: output 15 15 ns msb in msb out msb out data lsb out "1" "1" data lsb in msb in spiclk ci=0 output spiclk ci=1 output spimiso input spimosi output 167 166 161 160 161 166 165 167 166 167 163 162 164 msb msb msb out data lsb out "1" "1" data lsb in msb in spiclk ci=0 output spiclk ci=1 output spimiso input spimosi output 167 166 161 160 161 166 162 160 163 164 165 167 166
electrical characteristics motorola mc68360 user? manual 10-83 10.29 spi slave electrical specifications (the electrical specifications in this document are preliminary. see figure 10-77 and figure 10-78) figure 10-77. spi slave (cp = 0) num. characteristic 3.3 v or 5.0 v 5.0 v unit 25.0 mhz 33.34 mhz min max min max 170 slave cycle time 2? tcyc 171 slave enable lead time 15 15 ns 172 slave enable lag time 15 15 ns 173 slave clock (spiclk) high or low time 1? tcyc 174 slave sequential transfer delay (does not require deselect) 1 1 tcyc 175 slave data setup time (inputs) 20 20 ns 176 slave data hold time (inputs) 20 20 ns 177 slave access time 50 50 ns 178 slave spimiso disable time 50 50 ns 179 slave data valid (after spiclk edge) 50 50 ns 180 slave data hold time (outputs) 0?ns 181 rise time: input 15 15 ns 182 fall time: input 15 15 ns data lsb out undef. msb out msb in msb out msb in data lsb in spisel input spiclk ci=0 input spiclk ci=1 input spimiso output spimosi input 172 171 174 182 181 173 170 173 181 182 180 178 179 182 181 180 176 177 175
electrical characteristics 10-84 mc68360 user? manual motorola figure 10-78. spi slave (cp = 1) msb out data slave lsb out undef. undef. msb in data lsb in spisel input spiclk ci=0 input spiclk ci=1 input spimiso output spimosi input 174 182 181 173 182 181 178 179 181 179 177 175 170 173 171 172 180 176
electrical characteristics motorola mc68360 user? manual 10-85 10.30 jtag electrical specifications (the electrical specifications in this document are preliminary. see figure 10-79?igure 10-82) figure 10-79. test clock input timing diagram figure 10-80. trst timing diagram num. characteristic 3.3 v or 5.0 v 5.0 v unit 25.0 mhz 33.3mhz min max min max tck frequency of operation 0 25 0 25 mhz 1 tck cycle time in crystal mode 40 40 ns 2 tck clock pulse width measured at 1.5 v 18 18 ns 3 tck rise and fall times 0303ns 6 boundary scan input data setup time 10 10 ns 7 boundary scan input data hold time 18 18 ns 8 tck low to output data valid 0 30 0 30 ns 9 tck low to output high impedance 0 40 0 40 ns 10 tms, tdi data setup time 10 10 ns 11 tms, tdi data hold time 10 10 ns 12 tck low to tdo data valid 0 20 0 20 ns 13 tck low to tdo high impedance 0 20 0 20 ns 14 trst assert time 100 100 ns 15 trst setup time to tck low 40 40 ns v v tck 1 2 2 3 3 vm vm ih il (input) tck trst (input) (input) 15 14
electrical characteristics 10-86 mc68360 user? manual motorola figure 10-81. boundary scan (jtag) timing diagram figure 10-82. test access port timing diagram tck v v data output s data input s output data valid data output s output data valid data output s il ih input data valid 6 7 8 9 8 (input) tck v v td o tdi tm s output data valid td o output data valid td o il ih input data valid 10 11 12 13 12 (input) (input) (output) (output) (output)
electrical characteristics motorola mc68360 user? manual 10-87
electrical characteristics 10-88 mc68360 user? manual motorola
motorola mc68360 user? manual 11-1 section 11 ordering information and mechanical data this section contains the ordering information, pin assignments, and package dimensions for the mc68360. 11.1 standard ordering information package type frequency (mhz) temperature order number vcc quad flat pack (fe suffix) quad flat pack (fe suffix) quad flat pack with ethernet quad flat pack with ethernet 0?5 0?5 0?5 0?5 0 c to 70 c ?0 c to +85 c 0 c to 70 c ?0 c to +85 c mc68360fe25 mc68360cfe25 mc68en360fe25 mc68en360cfe25 5v +/- 5% pin grid array (rc suffix) pin grid array (rc suffix) pin grid array with ethernet pin grid array with ethernet 0?5 0?5 0?5 0?5 0 c to 70 c ?0 c to +85 c 0 c to 70 c ?0 c to +85 c mc68360rc25 mc68360crc25 mc68en360rc25 mc68en360rc25 5v +/- 5% quad flat pack (fe suffix) quad flat pack with ethernet 0?3 0?3 0 c to 70 c mc68360fe33 mc68en360fe33 5v +/- 5% pin grid array (rc suffix) pin grid array with ethernet 0?3 0?3 0 c to 70 c 0 c to 70 c mc68360rc33 mc68en360rc33 5v +/- 5% ball grid array (zp suffix)) ballgrid array with ethernet 0?5 0?5 0 c to 70 c mc68360zp25 mc68en360zp25 5v +/- 5% quad flat pack (fe suffix) quad flat pack with ethernet 0?5 0?5 0 c to 70 c mc68360fe25v mc68en360fe25v 3v +/- 0.3v pin grid array (rc suffix) pin grid array with ethernet 0?5 0?5 0 c to 70 c mc68360rc25v mc68en360rc25v 3v +/- 0.3v
ordering information and mechanical data 11-2 mc68360 user? manual motorola 11.2 pin assignment?40-lead quad flat pack (qfp) mc68360 / mc68en360 top view pin one indicator 1 10 20 30 240 220 230 irq5 irq3 irq2 pc0 pc1 pc2 gnd pc3 pc4 pc5 pc6 vcc pc7 pc8 pc9 pc10 gnd pc11 pb0 pb1 pb2 pb3 pb4 pb5 pb6 gnd pb7 pb8 pb9 pb10 gnd oe nc1 br vcc gnd bg bgack vcc irq4 irq6 gnd bkpt reseth trst tck tms tdi tdo perr avec rmc gnd vcc resets halt gnd irq1 berr ifetch 200 190 180 151 210 160 170 181 gnds1 cas3 cas2 vcc cas1 gnd cas0 freeze ds gnd r/w nc3 vcc dsack0 gnd dsack1 gnd prty3 prty2 gnd vcc prty1 prty0 ipipe0 as gnds2 ipipe1 vcc nc2 bclro a11 a10 gnd a9 a8 gnd vcc a7 a6 gnd a5 a4 vcc a3 a2 gnd a1 a0 tris irq7 cs7 cs6 cs5 cs4 gnd vcc cs3 cs2 cs1 cs0
ordering information and mechanical data motorola mc68360 user? manual 11-3 mc68360 / mc68en360 top view 100 110 120 121 130 140 31 40 50 60 70 61 80 90 vcc pb11 pb12 pb13 pb14 gnd pb15 pb16 pb17 pa5 pa6 pa7 pa8 vcc pa9 pa10 pa11 pa12 gnd pa13 pa14 pa15 pa0 gnd vcc pa1 pa2 pa3 pa4 gnd 150 d0 d1 gnd d2 d3 d4 vcc d5 d6 gnd d7 d8 d9 d10 d11 gnd d12 d13 d14 vcc d15 d16 gnd d17 d18 d19 clko2 gndclk vccclk clko1 d20 d21 d22 gnd d23 d24 d25 vcc d26 d27 d28 gnd d29 d30 d31 gnd vcc fc3 fc2 fc1 gnd fc0 siz1 siz0 vcc a31 a30 gnd a29 a28 vccsyn xfc gndsyn extal xtal modck0 modck1 gnd nc4 a27 a26 a25 gnd a24 a23 a22 vcc a21 a20 a19 gnd a18 a17 a16 a15 a14 gnd a13 a12 vcc
ordering information and mechanical data 11-4 mc68360 user? manual motorola 11.3 pin assignment?41-lead pin grid array (pga) 1 2 3 5 6 7 8 9 10 11121314 1516 1718 4 a b c d e f g h j k l m n p q r s t mc68360/mc68en360 (bottom view) siz0 siz1 fc2 d30 d27 d24 d21 clko1 clko2 d19 d16 d13 d10 d7 d4 d2 pa15 xtal a28 a29 fc1 fc3 d29 d26 d23 d20 d18 d15 d12 d9 d6 d3 d0 pa12 nc3 modck0 extal a30 fc0 d31 d28 d25 d22 d17 d14 d11 d8 d5 d1 pa13 pa9 a26 gnd modck1 xfc a31 ccclk pa14 pa10 pa6 a24 a25 a27 gndclk pa11 pa7 pa3 a21 a22 a23 gndsyn pa8 pa5 pa2 a18 a15 a19 a16 a20 a17 pa4 pa0 pa1 pb16 pb17 pb15 a12 a11 a13 a10 a14 a8 pb14 pb9 pb13 pb10 pb12 pb11 a9 a6 a7 a5 a4 a0 pb6 pb3 pb7 pb4 pb8 pb5 a3 a2 a1 irq7 cs7 cs4 gnds1 pb0 pc8 pb1 pc10 pb2 pc11 tris cs6 cs5 cs2 cs1 cas3 cas0 nc3 prty2 ipipe0 gnds2 nc2 ifetch irq4 trst td1 avec halt irq5 pc4 pc0 pc7 pc3 pc9 pc6 cs3 cs0 cas2 cas1 freeze ds r/w dsack0 dsack1 prty3 prty1 prty0 as ipipe1 bclro nc1 br bgack bg bkpt irq6 tck reseth tdo tms rmc perr berr resets irq3 irq1 pc1 irq2 pc5 pc2 oe v v ccsyn gnd gnd gnd v cc v cc v cc v cc gnd gnd gnd gnd gnd gnd gnd v cc nc v cc gnd gnd gnd gnd v cc gnd v cc gnd v cc gnd v cc v cc gnd v cc gnd v cc v cc gnd gnd gnd gnd v cc gnd gnd gnd gnd gnd v cc gnd gnd v cc v cc gnd v cc gnd gnd gnd note: pin p9 "nc" is for guide purposes only. v cc cc v
ordering information and mechanical data motorola mc68360 user? manual 11-5 11.4 pin assignment?57-lead ball grid array (bga) 68360 ompac top view 19 x 19 array 1.27mm pitch v u t s r p n m l k j h g f e d a b c 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 a31 a30 a29 a28 a27 a26 a25 a24 a23 a22 a21 a20 a19 a18 a17 a16 a15 a14 a13 a12 a11 a10 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0 fc3 fc2 fc1 fc0 siz1 siz0 dsack1 dsack0 r/ w as ds oe rmc br bg bgack bclro resth rests halt berr d31 d30 d29 d28 d27 d26 d25 d24 d23 d22 d21 d20 d19 d18 d17 d16 d15 d14 d13 d12 d11 d10 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 prty3 irq4 irq6 irq2 irq3 irq7 avec tris bkpt freez ipipe0 ipipe1 tck tms tdi perr pa15 pa14 pa13 pa12 pa11 pa10 pa9 pa8 pa7 pa6 pa5 pa4 pa3 vcc pa2 pa0 pc11 pc10 pc9 pc8 pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 cas3 cas2 cas1 cas0 nc4 nc3 nc2 nc1 tdo trst gnd xtal extal xfc modc k modck1 clko2 clko1 pb17 pb16 pb15 pb14 pb13 pb12 pb11 pb10 pb9 pb8 pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 cs7 cs6 cs5 cs4 cs3 cs2 cs1 cs0 vcc vcc vcc vcc vcc syn vcc vcc vcc vcc clk vcc vcc vcc vcc pa1 vcc vcc vcc vcc vcc vcc vcc vcc vcc vcc vcc vcc vcc gnd syn gnd gnd gnd gnd gnd gnd clk gnd gnd gnd gnd gnd gnd gnd irq5 irq1 ifetch prty2 prty0 prty1 nc nc nc nc nc nc nc nc nc nc nc nc nc nc nc nc nc nc nc nc nc nc nc nc
ordering information and mechanical data 11-6 mc68360 user? manual motorola 11.5 package dimensions?qfp (fe suffix) case 988-01 issue d date 03/16/95
        

        

    
    

 
  

    
   ! !  
           ! !   !  ! 
 ! 
!  
!  ! 
 ! 
!     
!  !   
           
            q q   "!  !  "   ! '      "  ! " 
 "#   ! " " ""    ! " %" "  %  "  &"! "   ' " " ""  "  "   "#!     "  "  " "#    !! !  $ "  "  " !"  "  !!     &#   ' !! # !!  " #!  "  "" !" ???? ???? ???? h ab q aa k 2 r 1 r q
  view ae z d f j !   
  ! " 240 places section ad p g ad ad x x = l, m or n view ac view ae u s    
         h n l t m y v b a w c e view ac 4 places !      !      " 4x 60 tips  
ordering information and mechanical data motorola mc68360 user? manual 11-7 11.6 package dimensions?ga (rc suffix) g g k c d a a1 a c d g k min max inches min max millimeters dim 1.840 1.880 0.110 0.140 0.016 0.020 0.150 0.170 a preliminary 18 0.100 basic bottom view 1 a t 46.74 2.79 0.41 2.54 3.81 47.75 3.56 0.51 basic 4.32 rc suffix 241 lead case pga
ordering information and mechanical data 11-8 mc68360 user? manual motorola 11.7 package dimensions?ga (zp suffix) 22.5 0.10 + 25.00 0.10 . + + 25.00 0.10 + 18 x 1.27 25 ? 5 ? + 0.60 0.10* *note: when soldered, this thickness will decrease significantly. + 0.80 0.10 + 0.36 0.10 + 1.76 0.10* + 18 x 1.27 ? 357 x 0.77 0.1 pin a1 is located in the corner indicated by the dot.
ordering information and mechanical data 11-9 mc68360 user? manual motorola
ordering information and mechanical data 11-10 mc68360 user? manual motorola
motorola mc68360 user? manual a-1 appendix a serial performance the quicc at 25 mhz was designed to support unrestricted operation of the high-level data link control (hdlc) or transparent protocol running on four serial communications control- lers (sccs) simultaneously at 2.048 mbps. the quicc can also support one ethernet chan- nel at 10 mbps and three hdlc or transparent channels at 2.048 mbps. the physical clocking limit of the sccs is higher than the sustained serial bit rate. this limit is given as a 1:2.25 ratio between the sync clock (a clock generated in the clock synthesizer that can be as fast as the 25-mhz system clock) and the serial clock. for example, with a sync clock of 25 mhz, the sccs may be clocked at 11.1 mhz. this clocking scheme allows for high-speed bursts of data bits to be handled by the sccs for short periods of time, sub- ject to the fifo sizes. when the sccs are connected to a time-division multiplexed channel using the time-slot assigner present on the quicc, the scc physical clocking limit is a 1:2.5 ratio between the sync clock and the serial clock. therefore, the sccs may be connected to a 10.0- mhz time- division multiplexed channel with a 25-mhz quicc. this clocking scheme allows for high- speed bursts of data bits to be handled by the sccs for short periods of time, subject to the fifo sizes. other devices that offer higher hdlc performance than the quicc are the motorola mc68605 1984 ccitt x.25 lapb controller and the mc68606 ccitt q.921 multilink lapd controller. the mc68605 and mc68606 perform the full data-link layer protocol as well as support various transparent modes within hdlc-framed operation at speeds of at least 10 mbps. the performance figures listed in table a-1 are for a 25-mhz system clock only.
serial performance a-2 mc68360 user? manual motorola notes: 1. these numbers are estimates generated prior to silicon. additional work will be performed to improve the accuracy of the scc performance numbers and will be reported in later revisions of this manual. 2. all performance calculations assume a 25-mhz system clock and sync clock for the sccs. the results scale linearly with different system clock speeds. a change in the sync clock will not affect performance as long as the required 1:2.25 or 1:2.5 ratio is maintained. 3. user should consult with receive and transmit clock timing of the sia to ensure clock pulse width high and width low are satis?d for high speed serial communications. 4. in all cases, the numbers assume data is stored in external system ram. 5. the performance is not expected to degrade based on the number of wait states in the system, as long as the system ram has between 0 and 9 wait states. 6. the performance table is also applicable when the time-slot assigner on the quicc is used. 7. when the performance of a high-speed channel together with a low-speed channel was measured, the high- speed channel was always scc1. 8. performance in hdlc bus mode is the same as hdlc performance, for both full duplex and half duplex operation. (half duplex is the normal con?uration of hdlc bus mode, thus hdlc half duplex performance numbers would normally be used.) 9. all results assume that the other risc features are not operating?.e., the risc timer tables, the idma auto buffer and buffer chaining modes, the parallel interface port, and the other serial channels. if these features are operating, performance may be slightly reduced. the dram refresh controller has no effect on the performance. 10. except for ethernet, all table results assume continuous full-duplex operation. results for half-duplex operation are roughly 2x better. 11. the smc performance results are without the sccs operating; otherwise, smc performance may be reduced. although the exact smc performance that can be obtained is determined by many risc utilization factors and is therefore dif?ult to estimate, it is expected that 9.6 kbps on both smc uarts could be simultaneously supported in most situations. high-speed channels low-speed channels comments/restrictions number speed number speed 1 hdlc 8 mbps 2 hdlc 4 mbps 3 hdlc 2.6 mbps 4 hdlc 2.05 mbps 1 enet 10 mbps 3 hdlc 2.05 mbps minor restrictions on hdlc buffer length 1 enet 10 mbps 2 hdlc 2.05 mbps 2 enet 10 mbps 1 hdlc 1 mbps 4 uart 625 kbps async scc 4 uart-s 625 kbps sync uart scc 4 bisync 460 kbps 1 tran 8 mbps 2 tran 4 mbps 3 tran 2.6 mbps 4 tran 2.05 mbps 2 tran 1.56 mbps smc channels 2 uart 100 kbps smc channels
motorola mc68360 user? manual b-1 appendix b development tools and support several software development packages are offered as a set of independent modules that provide the following features: quicc chip evaluation by running the modules on the development board described in b.4 m68360quads development system, it is possible to examine and evaluate the quicc. symbolic, user-friendly menus allow control of all parts of the quicc. quicc simple drivers written in c, the source code of the quicc drivers is available on the motorola free- ware bulletin board (512-891-3733, 8 data, no parity, 1 stop) or through anonymous ftp to freeware.aus.sps.mot.com under /pub/mcu360. these drivers were developed to support the needs of the general user. although they are based on the regular quicc drivers, they provide call-oriented interfaces and self-contained quicc initial- ization routines and interrupt handling for a given protocol. quicc chip drivers written in c, the source code of the quicc drivers is available on electronic media. these drivers were developed to support the needs of the protocol implementations. protocol implementations modules implementing common iso/osi layer 2 and 3 protocols are available under license. these are in the form of source code written in c. portability all of the higher layer software modules may be ported from source to different quicc implementations and combined with user-developed code. software interface docu- mentation is available for all provided modules. b.1 motorola software modules chip driver routines written in c illustrate initialization of the quicc, interrupt handling, and the management of data transmission and reception on all channels. in addition to the chip drivers, protocol modules are provided. layer 2 modules include lapb and lapd. the layer 3 module is the x.25 packet layer protocol. since the modules require some minimal operating system services, the edx operating sys- tem kernel is provided. edx is the kernel implemented on the quads board (see b.4 m68360quads development system). use of edx with the protocol modules is not required as long as some other operating system support is provided by the user.
development tools and support b-2 mc68360 user? manual motorola all modules communicate with each other using message passing. this technique simplifies the interfaces between the different modules and enables them to interface with other user- added modules with relative ease. descriptions of the software interfaces are available. each module operates completely independent of its environment. independence from the hardware environment is achieved by the fact that each module is individually configurable and relocatable anywhere in system memory. calls are used for requesting resources or services from the resident operating system (memory management and message passing), which creates independence from the firmware. modules may be used with any combination of other modules, including those added by the user (see figure b-1). figure b-1. software overview the chip driver module and simple driver module features are as follows: provides all software modules with an interface to the quicc illustrates quicc initialization and interrupt handling provides complete configuration of the quicc on system start (or restart) provides services for the quicc serial ports edx real-time kernel or user-supplied o.s. communicates with all modules below o.s. support driver module lapd module lapb module x.25 module layer 2 layer 3 layer 1 user-supplied user-supplied user-supplied layer 4 user-supplied modules can be integrated at any level the 68360 does some layer 2 functions (e.g., address recognition) message passing is the only form of intermodule communication access to the 68360 is made through the driver mc68360 device
development tools and support motorola mc68360 user? manual b-3 ?supports linked lists of frames for both transmit and receive ?provides error handling and recovery for both transmit and receive ?supports all serial ports in different protocol configurations ?provides internal loopback (frames not sent to quicc) provides timer services can be configured to send trace messages to a system log file supports up to 24 serial ports the lapd module features are as follows: fully implements 1988 ccitt recommendation q.920/q.921 supports up to 12 physical channels (8192 logical links per channel) supports management and broadcast links supports user and network applications uses dedicated transmit pool for fast control frame generation dynamic modification of protocol parameters independent of layer 1 and layer 3 implementation independent of layer 2 management message-oriented interface independent configuration of upper and lower layer modules interfacing with each lapd link special mode for internal loopback between pairs of links supports external loopback between two quicc serial channels or on the same serial channel trace option for reporting to system management each primitive issued by the lapd module to the layer 3 or layer 2 management the lapb module features are as follows: fully implements 1988 ccitt recommendation x.25, chapters 2.1?.4 supports up to 12 distinct physical channels with each operating as an independent sta- tion modulo 8 or 128 operation applicable for dte and dce applications uses dedicated transmit pool for fast control frame generation dynamic modification of protocol parameters independent of layer 1 and layer 3 implementation message-oriented interface independent configuration of upper and lower layer modules interfacing with each lapb link special mode for internal loopback (frames are not sent to the driver)
development tools and support b-4 mc68360 user? manual motorola supports external loopback between two quicc serial channels or on the same serial channel trace option for reporting to system management each primitive issued by the lapb module to layer 3 or layer 2 management the x.25 module features are as follows: fully implements 1988 ccitt recommendation x.25, chapters 3.1?.3 may be used with both layer 2 modules: lapd or lapb unlimited number of layer 2 interfaces supports up to 4095 logical channels for each interface many dte/dce interface parameters (configurable for each interface): ?te/dce ?odulo 8 or 128 operation ?indow size ?aximum receive and transmit packet lengths layer 4 message fragmentation/assembly using m-bit q-bit support all standard ccitt x.25 facilities compatible with x.213 interface primitives logical channel parameters (configurable for each interface): ?nterface id ?te/dce ?ermanent virtual circuit/virtual call ?-bit support ?n-line registration support ?oa/npi address mode ?ast select facility support ?ogical channel (and group) numbers ?rotocol parameters (w, t11, t12, t21, t22, n12, n13) ?aximum data packet length (unlimited) message-oriented interface independent of layer 2 and layer 4 implementation the edx module features are as follows: the edx event-driven executive is an operating system kernel that provides: ?ultitasking with simple task scheduling ?essage passing between tasks ?emory allocation edx was designed to be: ?ast (written mostly in m68000-family assembler) ?fficient (uses approximately 1.5 kbytes of rom)
development tools and support motorola mc68360 user? manual b-5 edx was designed for use in communications environments. it provides "soft" real-time scheduling, not the "hard" real-time scheduling needed in many event control applica- tions. the approximate compiled object-code sizes are as follows: 1. chip drivers 35k 2. lapd 35k 3. lapb 30k 4. x.25 60k 5. edx 2k object-code sizes may be reduced from these figures if optional module features are not compiled. a ram scratchpad area (around 4 kbytes) and buffer space are also required for the modules (except for edx). an additional user-interface module is used on the quads board. the user-interface mod- ule, which supports a window-based host program running on the host computer, interfaces to the quicc and each functional protocol module. this module may be used for chip eval- uation or as a tool for debugging user-developed applications. menu options allow the user to issue specific commands or to examine the appropriate module's memory structures (or the quicc register set and on-chip dual-port ram). the commands may result in specific quicc commands or in the execution of protocol-defined primitives in one of the protocol modules. the chip driver module is available in c-language source-code form and is included in object-code form on the quads board. the source code requires no license. the lapb, lapd, and x.25 modules are available in c-language source-code form and are also included in object-code form on the quads board. the code requires a license from motorola. note if the chip driver, lapb, lapd, or x.25 modules are to be used on the quads board, an adi board is also required to be able to download register settings from your pc or sun system. the edx kernel is available in c and assembler source-code form and is included in object- code form on the quads board. the source code requires a license from motorola. contact the local motorola sales office for license terms. b.2 other protocol software support third parties also offer additional protocols that may be used with the quicc. they include isdn protocols such as q.931 and general communication protocols such as tcp/ip. con- tact the local sales representative for information on third-party protocols.
development tools and support b-6 mc68360 user? manual motorola b.3 third-party software support since the quicc is a memory-mapped device based on a cpu32+ core, existing compilers, source-level debuggers, assemblers, and linkers designed for the cpu32 family may be successfully used. many third parties supply such tools as well as software tools specifically designed to work with the quads board. note the cpu32+ enhancements over the cpu32 are compatible with existing cpu32 software tools. b.4 m68360quads development system the m68360 quicc application development system (m68360quads) is a standalone board that includes the previously discussed software modules, a board-level kernel (edx), and a monitor/debugger (cpu32bug). it is a flexible yet lower cost alternative to full in-cir- cuit emulation. it also provides an immediate platform for developing and testing hardware and software. the quads board is a follow-on to the mc68302 ads board. users of the mc68302 ads board will find the quads to be similar in approach and flexibility. the quads board consists of a master quicc (full ethernet version mc68en360), mem- ory (1 mbyte of dram simm with parity, 512 kbytes of flash eprom, 128 kbytes of boot eprom, and 256 bytes of eeprom), and a slave quicc (full ethernet version mc68en360) to implement serial (rs-232) and parallel (adi) ports needed by the quads board. this configuration leaves all resources of the master quicc available to the user (see figure b-2). the flash eprom has on-board programming capabilities that allow the user to program their own software on the board or update the software provided by motorola.
development tools and support motorola mc68360 user? manual b-7 figure b-2. quads system in addition, the quads board provides the hardware connection for a bdm input connection to the master quicc so that third-party bdm software may be used to control the quads board. the user may wish to begin writing software on the quads board without waiting for the target board to be completed. the quads board allows this by providing the hardware con- nections to ethernet (twisted-pair and aui), localtalk (appletalk), and an rs-232 port. the ethernet connection offers full support of twisted-pair and aui through the use of the master mc68360 host machine: ibm pc, sun-3, or sun-4 adi board (not shown) with parallel cable plugs into host logic analyzer for code and bus analysis 1mb dram parallel port optional standalone vt100 terminal port from host computer serial port m68360 quads card analyzer cable 512kb feprom slave mc68360 bdm output ethernet rj-45 ethernet aui localtalk mini-din8 bdm input user application hardware ports mc68160 eest
development tools and support b-8 mc68360 user? manual motorola mc68160 eest device. the localtalk connection is made through an rs-422 transceiver. applications not needing localtalk can use the rs-422 to implement other proprietary lans. the bdm output connector allows the quads board to control another device using background debug mode. all these connections are made through the slave quicc to pre- vent master quicc resources from being impacted. if the user application includes a need for the rs-232 port, the system rs-232 port may be used for the application if the host computer is connected to the quads board via the par- allel port. more detail of the quads system is shown in figure b-3. buffers are provided in this system so that the system functions do not affect the fanout of the expansion connector. in a real application, such buffers and the local bus arbiter are not necessarily required. the slave quicc provides the system integration functions (such as chip selects) that would normally be provided by the quicc's own sim. thus, the expansion connectors provide all the mas- ter quicc resources without using these resources and provide a non-degraded quicc electrical interface. to assist with target board development, the quads board may be connected to the target board through the edge connectors or through a pga connector using a flexible pc board supplied by a third party. (adapters from pga to pqfp are also available from third parties.) prototype boards may therefore make use of signals available from the quads develop- ment board. target board execution may be carried out with the quicc executing from the quads board memory, from target board memory, or a combination of both. the quads board also contains connections for use by a logic analyzer, allowing all quicc pins to be examined. connectors between the quads board and common logic analyzers are available from third parties. to connect the quads board to a host computer, a parallel interface cable and host inter- face (adi) board are supplied. hosts include the ibm-pc and sun-4 systems. available software executing on the host allows uploading and downloading of files and data between the host and the quads board and allows control of the user interface module through a window-based interface program resident on the ibm-pc or sun-4. source-level debugging support through this interface and the serial interface is provided by third-party vendors. note the adi boards mentioned here are the same adi boards used with the mc68302 ads system. if the user already purchased an adi board for a mc68302 development project, that same board may be used with the quads board as long as the adi board supports the ibm-pc, or sun-4. the user only has to ob- tain new host software (available on the bbs) to interface to the quads board.
development tools and support motorola mc68360 user? manual b-9 figure b-3. quads block diagram to connect the quads board to a host computer, a parallel interface cable and host inter- face (adi) board are supplied. hosts include the ibm-pc and sun-4 systems. available software executing on the host allows uploading and downloading of files and data between the host and the quads board and allows control of the user interface module through a window-based interface program resident on the ibm-pc. source-level debugging support through this interface and the serial interface is provided by third-party vendors. to serve as a convenient platform for software development, the quads board is supplied with a simple kernel and a cpu32bug monitor/debugger. the real-time kernel (edx) offers basic operating system services such as multitasking and memory management. the cpu32bug monitor/debugger provides operations of memory dump and set (with optional assembly/disassembly of cpu32+ instructions), single instruction execution, breakpoints, and downloads over the serial and parallel interfaces. additionally, the quads board contains the software modules (protocol, driver, and user interface modules) in eprom or in downloadable s-record format. an adi board is required if the software (360sw) provided with the protocol or driver modules is to be used on the adi port rs-232 port localtalk port quicc (master) quicc (slave) bdm connector mc68160 eest logic analyzer connectors expansion connectors buffers local bus arbiter and buffer control 256-byte serial eeprom 512-kbyte flash memory (32 bits wide) 1-mbyte dram with parity (36-bit-wide simm) ethernet port aui connector ethernet port rj-45 connector bdm controller port 128-kbyte boot eprom (8 bits wide)
development tools and support b-10 mc68360 user? manual motorola quads board. that is, in order to use the .g files on the ibm/pc or sun-4 system to down- load register settings to the quads board, an adi card must be available to download these .g files through the serial port. the .g files can not be downloaded from the serial port on the quads board. also, downloading a file to the quads boards is much faster through the parallel port versus the serial port. b.5 other development boards additional third-party support includes very low-cost development boards for the quicc as a standalone device. additionally, third parties will include specialized development boards for such applications as the quicc's mc68040 companion mode, which has the mc68040 and the quicc on the same board. contact the local sales representative for information on third-party development boards. b.6 direct target development the quicc bdm, along with its on-chip hardware breakpoint capabilities, make it possible for some low-budget development projects to eliminate the development board or emulator. third parties have software support that allows direct use of the quicc background debug port. thus, with a tool such as an ibm-pc for software development, a simple hardware con- nection between the pc and the quicc bdm, and a pc software package that controls the quicc through the bdm, an inexpensive "direct target" development environment is obtained.
motorola mc68360 user? manual c-1 appendix c risc microcode from ram the risc processor in the quicc has an option to execute microcode from the first 512 or 1024 bytes of the internal dual-port ram. motorola uses this feature to enhance existing pro- tocols or implement additional protocols. customers can purchase one or more of these ram microcodes in an object-code format and download it to the quicc dual-port ram dur- ing system initialization. the ram microcode is provided by motorola as a set of s-records that can be downloaded directly to an application development system or stored in a system eprom. after system reset, the binary of the microcode should be copied to the quicc dual-port ram. the quicc registers, including the risc controller configuration register (rccr), should be ini- tialized as specified in the microcode ram documentation. before the risc is used in the system, the user should issue a reset command to the communications processor command register (cr). the microcode ram functions are available in addition to all protocols avail- able in the standard quicc microcode rom. the following microcode ram protocols are completed, in progress, or under consideration by motorola. please contact the local motorola semiconductor sales office for further infor- mation on these packages. c.1 signaling system #7 controller signalling system #7 (ss7) is a management protocol used in public switching networks. the physical, data link, and network layer functions of the ss7 protocol are called the mes- sage transfer part (mtp). the data link layer portion of the mtp (layer 2) is based upon hdlc frame formats. how- ever, ss7 at layer 2 also includes some unique functions that are difficult to implement using an unaltered hdlc controller. these functions include: counting the number of octets by which a frame is too long; sending fill in signal units (fisus) and link status signal units (lssus) continuously; maintaining the su error monitor; and filtering duplicate back-to- back frames. fisus are 5 byte frames (three bytes plus 2 crc bytes) that are sent continuously back-to- back when no other data needs to be transmitted. lssus are also sent back-to-back during the initial alignment of the protocol. lssus are 6 or 7 bytes long. ss7 also differs from other hdlc-based protocols in that the closing flag of one frame can be the opening flag of the next frame. since these characteristics can make ss7 implementations very demand- ing, the ss7 controller on the quicc provides additional help in these areas.
risc microcode from ram c-2 mc68360 user? manual motorola this controller only performs the lowest layers of the ss7 protocol stack. the upper layers must be performed in software by the cpu in the system. the software to perform the upper layer protocol is available from third party providers. the ss7 controller contains the following key features: uses either nmsi or tdm interface and a variety of data encoding schemes. flexible data buffers with multiple buffers per signal unit allowed. separate interrupts for received signal units and transmitted buffers. maintenance of good frame counter, bad frame counter, and su error monitor. standard hdlc features: ?lag/abort/idle generation/detection ?ero insertion/deletion ?6-bit crc-ccitt generation/checking ?etection of non-octet aligned signal units ?rogrammable number of flags between signal units ?etection of long sus. ?iscard short (less than 5 octets) signal units. ?utomatic fill-in signal unit transmission. ?utomatic link status signal unit retransmission. ?utomatic discard of identical fisus and lssus. ?ctet counting mode support. ?ommand to force a reset of filtering state. ?ommand to force entry into octet counting mode. ?bility to permanently disable octet counting mode. ?bility to disable fisu and lssu filtering. ?bility to force entry into octet counting mode if a receiver overrun occurs. ?onsumes 1280 bytes of the quicc? internal memory. c.1.1 performance at 25mhz, an aggregate ss7 bandwidth of 6 mbps divided among the 4 sccs consumes 100% of the processing power of the risc communications engine. if only a percentage of the total available ss7. bandwidth is used, the remaining risc processing power can be used to run other protocols on other channels. table c-1 shows possible quicc configurations. table c-1. ss7 configuration ss7 channels risc bandwidth consumed (est) possible configuration of other channels 1 x 64 kbit/s 1% 1 x 10 mbit ethernet, 2 x 2.048 mbit hdlc 2 x 64 kbit/s 2% 2 x 4 mbit hdlc, 2 x 19.2 kbit smc uart 3 x 64 kbit/s 3% 1 x 6 mbit hdlc, 2 x 19.2 kbit smc uart
risc microcode from ram motorola mc68360 user? manual c-3 c.2 multiple gci controller the mc68360 quad integrated communications controller (quicc) can handle connec- tions over two basic rate isdn links using its serial management controllers. for connection to more than two isdn links, the multiple gci (mgci) ram-based microcode provides gen- eral circuit interface (gci) handling functions for up to 16 basic rate isdn subscriber lines. mgci can be used in any application where multiple isdn lines need to be terminated, such as 2, 4, 8, or 16-subscriber isdn line cards and video servers. associated with each isdn subscriber line is a monitor channel, a c/i channel, two b-chan- nels, and one d-channel. mgci handles only the monitor and c/i channels and has no effect on the b and d channels. c.2.1 typical application figure c-1 shows a typical 16-subscriber isdn line card using mgci in an isdn switch. each subscriber line is terminated on the line card by a u or s/t line transceiver (e.g. mc145572 or mc145574). the multiplexer logic converts between the 16 individual basic rate gci circuits and time division multiplex links carrying the d, b and control channels. the b channels are routed to the main system via the system interface while the d-channels are handled on the board. the c/i and monitor channels are used on the board to carry control and status information between the mc68360 and the line transceivers. c.2.2 mgci controller key features implements isdn gci and analog gci monitor channel and c/i channel protocols. handles gci monitor message reception and transmission automatically. handles four and six bit c/i code reception and transmission. user programmable c/i receiver detection mechanism: single change or double last look. figure c-1. typical 16-subscriber isdn line d-channel signalling controller mc68360 quicc address & data uart tdma tdmb memory multiplexer system interface mc145572 subscriber interfaces system backplane 16 d 16 c/i + m 3 hdlc 16 2b 16 2b+d+c/i+m gci
risc microcode from ram c-4 mc68360 user? manual motorola all receive data is timestamped. handles 2, 4, 8, or 16 isdn lines with full c/i and monitor channel functions. handles up to 32 isdn lines with only c/i channels. simultaneous detection of multiple c/i code changes and transmission changes. maskable interrupts generated for many events. handles gci monitor messages from 1 to 64 kilobytes in length. monitor receiver can be locked into a particular channel. monitor receiver and transmitter include timers to prevent lockup due to inactivity. operates independently of user cpu activity. consumes 1280 bytes of the quicc? internal memory. c.2.3 performance at 25mhz, an mgci serial bit rate of 2 mbps on one scc consumes 20 - 25% of the pro- cessing power of the risc communications engine. an mgci scc operating at a serial bit rate of 2mbps carries 32 x 64kbit channels, table c-2 shows possible quicc configuration. c.3 atom1/atm controller atom1 provides physical layer atm functions by converting one or more of the quicc? serial communication controllers (sccs) into an atm cell transmitter and receiver. the microcode provides the user with basic cell streaming facilities (cell reception and transmis- sion) and event indications. the primary application of atom1 is intended to be plesiochro- nous digital hierarchy (pdh) and synchronous digital hierarchy (sdh) e1 and ds1 atm equipment. such equipment is used for signalling and low rate data transfer. figure c-2 shows an atm / frame relay interworking system as may be used in remote bridging applications. using the ethernet channel available on the quicc, remote lan bridging equipment can be constructed to link remote ethernet lans over e1 telecommuni- cations links. c.3.1 key features cell transmission and reception for all aal protocols. transmit and receive data buffers located in main memory. microcode constructs the cell header and appends user defined payload on transmit. microcode verifies cell headers and strips hec before passing cell to the user on re- ceive. table c-2. mgci scc configuration mgci sccs risc bandwidth consumed (est) possible configuration of other channels 1 x 2 mbit/s 25% 3 x 2 mbit hdlc, 2 x 9.6 kbit smc uart 2 x 2 mbit/s 50% 2 x 2 mbit hdlc, 2 x 9.6 kbit smc uart
risc microcode from ram c-5 mc68360 user? manual motorola empty cells transmitted when there are no pending data transfers. empty cells and cells with non-matching headers are automatically discarded on re- ceive. scrambling option is provided utilizing the self-synchronizing x 43 + 1 scrambling poly- nomial. incoming cells with incorrect hecs are received and marked. bandwidth reservation mechanism in the transmitter to allow mixing of data and isoch- ronous services. cam support on reception for handling many connections. ?onsumes 1280 bytes of the quicc? internal memory. c.3.2 performance at 25 mhz, an aggregate atom1 bandwidth of 10 mbps divided among the 4 sccs con- sumes 100% of the processing power of the risc communications engine. if only a percent- age of the total available atom1 bandwidth is used, the remaining risc processing power can be used to run other protocols on other channels. table c-3 shows the possible quicc configuration. figure c-2. atm/frame relay interwork system cpu32+ core periodic system protection clock generator risc cp 14 sdmas 2 idmas 4timers interrupt controller dual port ram scc1 scc2 scc3 scc4 smc1 smc2 spi time slot assigner mc68360 quicc cpm sim 32-bit dram 32-bit sram 8-bit boot rom e1 atm line transceiver e1 atm line transceiver frame relay driver rs-232 driver e1 atm e1 atm frame relay uart system interface system clock generator chip selects dramc sramc
risc microcode from ram c-6 mc68360 user? manual motorola c.4 asynchronous hdlc for ppp asynchronous hdlc is a frame-based protocol (see figure 3), defined by the internet engi- neering task force (ietf) "request for comments #1549" which uses hdlc framing tech- niques in conjunction with uart-type characters. this protocol is typically used as the physical layer for the point-to-point (ppp) protocol. while this protocol can be implemented by the uart controller on the quicc in conjunction with the cpu32+, it is more efficient and less compute-intensive for the cpu to allow the communications processor module (cpm) of the quicc to perform the framing and transparency functions of the protocol. c.4.1 key features flexible data buffer structure which allows an entire frame or a section of a frame to be transmitted and received. separate interrupts for received frames and transmitted buffers. automatic 16-bit crc generation and checking (crc-ccitt). automatic generation of opening and closing flags. table c-3. atom1 configuration atom1 channels risc bandwidth consumed (est) possible configuration of other channels 1 x 6 mbit/s with scrambling 90% 3 x 64kbit hdlc or transparent 1 x 10 mbit/s non-scrambling 90% 2 x 64kbit hdlc or transparent 2 x 2 mbit/s with scrambling 40% 2 x 2.5 mbit hdlc or transparent, 9.6 kbit smc uart 2 x 2 mbit/s non-scrambling 40% 1 x 10 mbit ethernet, 9.6 kbit smc uart figure c-3. asynchronous hdlc block diagram ethernet mc68360 quicc scc1 scc2 scc3 mc68160 eest wan interface wan interface asynchronous hdlc rs232 driver scc4 modem
risc microcode from ram c-7 mc68360 user? manual motorola reception of frames with only one ?hared?flag. automatic generation and stripping of transparency characters according to the internet engineering task force rfc 1549 utilizing transmit and receive control character maps. automatic transmission of the abort sequence (0x7d,0x7e) after the stop trans- mit command is issued. automatic transmission of idle characters between frames and characters. consumes 768 bytes of the quicc? internal memory. c.4.2 performance at 25mhz, an aggregate asynchronous hdlc bandwidth of 3 mbps divided among the 4 sccs consumes 100% of the processing power of the risc communications engine. if only a percentage of the total available asynchronous hdlc bandwidth is used, the remaining risc processing power can be used to run other protocols on other channels. table c-4 shows the ahdlc configuration c.5 profibus controller process field bus (profibus) is a uart- based master slave protocol that specific data between 9.6 kbps to 1.525 mbps. the profibus protocol is mainly used in industrial pro- cess control applications. the protocol is defined in the german din standard 19 245. the profibus microcode running on the quicc risc controller assists the core in han- dling some of the time-critical profibus link layer functions, leaving more of the core avail- able for the application software. c.5.1 key features frame preceding idle sequence generation/checking flexible frame oriented data buffers separate interrupts for frames and buffers (receive and transmit) maintenance of six 16-bit error counters two address comparison registers with mask frame error, noise error, parity error detection detection of idle in middle of a frame check sum generation/checking table c-4. ahdlc configuration ahdlc channels risc bandwidth consumed (est) possible configuration of other channels 1 x 115 kbit/s 4% 1 x 10mbit ethernet, 2 x 1.5 mbit hdlc, 9.6 kbit smc uart 2 x 230 kbit/s 15% 1 x 10mbit ethernet, 1 x 1.5 mbit hdlc, 9.6 kbit smc uart 3 x 230 kbit/s 24% 1 x 5mbit hdlc, 2 x 9.6 kbit smc uart
risc microcode from ram c-8 mc68360 user? manual motorola end delimiter (ed) generation/checking init rx/tx, stop tx, restart tx and enter hunt mode commands token rotation timer, idle timer, slot timer and time-out timer consumes 1280 bytes of the quicc? internal memory. c.6 enhanced ethernet filtering the enhanced ethernet filtering microcode has been created to add a bit more flexibility to the current ethernet controller. it allows the user to perfectly accept or reject frames with destination addresses that are contained in a table of 24 entries. in addition to the filtering capability, the microcode adds the ability to replace the externally sampled tag byte with one that is extracted from the address table. c.6.1 key features can accept or reject incoming frames if the destination mac address is contained in a list of 24 preprogrammed entries. allows a shorter list to obtain better peripheral performance. can optionally tag incoming accepted frames with an 8-bit tag appended to the end of the frame (rather than using a cam). the filtering can be turned off to allow tagging with no frame rejection. can filter on group and individual addresses. is a ?mall?microcode (consumes 768 bytes of dpram). filtering is only supported on one ethernet channel (scc1), the other channel operates normally. c.6.2 performance the overhead incurred by the filtering algorithm will depend upon the number of entries in the address table. table c-5 shows possible configurations of other channels given the load added by a number of entries in the address table. table c-5. channel configuration number of addresses possible configuration of other channels 1-8 1 x 10 mbit ethernet, 1 x 200 kbit hdlc 9-16 1 x 10 mbit ethernet, 1 x 200 kbit hdlc 17-24 1 x 10 mbit ethernet
motorola mc68360 user? manual d-1 appendix d mc68mh360 product brief the mc68mh360 is a derivative of the mc68360 quicc. ? it is also known as the quicc32. ? the quicc32 has some modifications in the communication processor module (cpm) hardware and a larger internal dual port ram. these hardware changes in combination with a new rom based microcode, called qmc (quicc multichannel controller), emulates up to 32 hdlc channels within one scc. the mh360 is ideal in primary rate isdn applications and interfaces directly to a e1/t1 line and is capable of terminating all time slots using hdlc or transparent mode of operation. one of the time slot assigners (si) is dedicated to the use of the qmc. the si transfers the whole frame or selected time slots to one scc. all other features remain unchanged and the quicc32 is pin compatible with the other family mem- bers. a quicc32 in non-qmc mode has exactly the same functionality as a standard mc68360 with the exception that the centronics and bisync protocols have been removed on the quicc32 to create rom space for the qmc protocol. d.1 quicc32 key features the following list summarizes the key mc68mh360 quicc32 features: d.1.1 general up to 32 independent communication channels arbitrary mapping of any of 0-31 channels to any of 0-31 tdm time slots can support arbitrary mapping of any of 0-31 channels to any of 0-63 tdm time slots in case of common rx & tx mapping independent mapping for receive/transmit supports either quicc transparent or quicc hdlc protocols for each channel quicc-like manner for channel programming and parameter passing up to 64 dma channels with linear buffer array interrupt circular buffer with programmable size and overflow identification global loop mode individual channel loop mode programmable frame length (via quicc? si)
mc68mh360 product brief d-2 mc68360 user? manual motorola d.1.2 serial interface serial multiplexed (full duplex) input/output 2048, 1544 or 1536 kbps pcm - high- ways compatible with t1/ds1 24 channel and cept/e1 32 channel pcm highway, isdn basic rate, isdn primary rate, user defined sub channeling on each time-slot allows independent transmit and receive routing, frame syncs, clocking concatenation of any, not necessarily consecutive, time slots to channels indepen- dently for receive/transmit supports h0, h11, h12 isdn - channels allows dynamic allocation of channels up to 3 additional hdlc 64 kbps channels at 25 mhz system clock when in qmc mode ethernet support at 33 mhz system clock on one scc when operating in qmc mode d.1.3 system interface quicc powerful system support features: cpu32+, slave mode, 040 companion, memory controller, 2xidma, sim60 watchdogs, bus monitors, timers, low power modes, breakpoint logic, interrupt controller on-chip bus arbitration for serial dmas with no performance penalty efficient bus usage (no bus usage for non-active channel, and for active channels that have nothing to transmit) efficient control of the interrupts to the cpu supports external buffer descriptors table using on-chip enlarged dual-port ram for parameter storage d.2 quicc architecture overview the quicc is 32-bit controller that is an extension of other members of the motorola m68300 family. like other members of the m68300 family, the quicc incorporates the inter- module bus (imb). (the mc68302 is an exception, having an m68000 bus on chip.) the imb provides a common interface for all modules of the m68300 family, which allows motorola to develop new devices more quickly by using the library of existing modules. although the imb definition always included an option for an on-chip 32-bit bus, the quicc is the first device to implement this option. the quicc consists of three modules: the cpu32+ core, the sim60, and the cpm. each module uses the 32-bit imb. the mc68360 quicc block diagram is shown in figure d-1.
mc68mh360 product brief motorola mc68360 user? manual d-3 figure d-1. quicc block diagram d.2.1 cpu32+ core the cpu32+ core is a cpu32 that has been modified to connect directly to the 32-bit imb and apply the larger bus width. although the original cpu32 core had a 32-bit internal data path and 32-bit arithmetic hardware, its interface to the imb was 16 bits. the cpu32+ core can operate on 32-bit external operands with one bus cycle. this allows the cpu32+ core to fetch a long-word instruction in one bus cycle and to fetch two word-length instructions in one bus cycle, filling the internal instruction queue more quickly. the cpu32+ core can also read and write 32-bits of data in one bus cycle. although the cpu32+ instruction timings are improved, its instruction set is identical to that of the cpu32. it will also execute the entire m68000 instruction set. it contains the same background debug mode (bdm) features as the cpu32. no new compilers, assemblers, or other software support tools need be implemented for the cpu32+; standard cpu32 tools can be used. the cpu32+ delivers approximately 4.5 mips at 25 mhz, based on the standard (accepted) assumption that a 10-mhz m68000 delivers 1 vax mips. if an application requires more external bus interface system protection sim 60 cpu32+ core imb (32 bit) risc controller system i/f 2.5-kbyte dual-port ram dram controller and chip selects cpm periodic timer clock generation other features breakpoint logic jtag communications processor four general- purpose timers interrupt controller other features timer slot assigner seven serial channels two idmas fourteen serial dmas
mc68mh360 product brief d-4 mc68360 user? manual motorola performance, the cpu32+ can be disabled, allowing the rest of the quicc to operate as an intelligent peripheral to a faster processor. the quicc provides a special mode called mc68040 companion mode to allow it to conveniently interface to members of the m68040 family. this two-chip solution provides a 22-mips performance at 25 mhz. the cpu32+ also offers automatic byte alignment features that are not offered on the cpu32. these features allow 16 or 32-bit data to be read or written at an odd address. the cpu32+ automatically performs the number of bus cycles required. d.2.2 system integration module (sim60) the sim60 integrates general-purpose features that would be useful in almost any 32-bit processor system. the term ?im60?is derived from the quicc part number, mc68360. the sim60 is an enhanced version of the sim40 that exists on the mc68340 and mc68330 devices. first, new features, such as a dram controller and breakpoint logic, have been added. sec- ond, the sim40 was modified to support a 32-bit imb as well as a 32-bit external system bus. third, new configurations, such as slave mode and internal accesses by an external master, are supported. although the quicc is always a 32-bit device internally, it may be configured to operate with a 16-bit data bus. regardless of the choice of the system bus size, dynamic bus sizing is supported. bus sizing allows 8-, 16-, and 32-bit peripherals and memory to exist in the 32- bit system bus mode and 8- and 16-bit peripherals and memory to exist in the 16-bit system bus mode. d.2.3 communications processor module (cpm) the cpm contains features that allow the quicc32 to excel in communications and control applications. these features may be divided into three sub-groups: communications processor (cp) two idma controllers four general-purpose timers the cp provides the communication features of the quicc32. included are a risc proces- sor, four sccs, two smcs, one spi, 2.7 kbytes of dual-port ram, an interrupt controller, a time slot assigner, three parallel ports, a parallel interface port, four independent baud rate generators, and fourteen serial dma channels to support the sccs, smcs, and spi. the idmas provide two channels of general-purpose dma capability. they offer high- speed transfers, 32-bit data movement, buffer chaining, and independent request and acknowledge logic. the risc controller may access the idma registers directly in the buffer chaining modes. the quicc32 idmas are similar to, yet enhancements of, the two dma channels found on the mc68340 and the one idma channel found on the mc68302. the four general-purpose timers on the quicc32 are functionally similar to the two general- purpose timers found on the mc68302. however, they offer some minor enhancements,
mc68mh360 product brief motorola mc68360 user? manual d-5 such as the internal cascading of two timers to form a 32-bit timer. the quicc32 also con- tains a periodic interval timer in the sim60, bringing the total to five on-chip timers. d.2.3.1 quicc32 serial configurations. the quicc32 offers an extremely flexible set of communications capabilities. although a full understanding of the possibilities requires reading the appropriate sections, some of the possibilities are shown in the following dia- grams. they show possible connections between quicc32 devices. in addition, connec- tions are often shown between quiccs and the mc68302 to show the compatibility between these devices. for readability, transceivers are usually omitted in the following diagrams. for local on- board communications, however, transceivers are often optional and depend on the proto- col used. figure d-2 shows the ethernet lan capability of the quicc32. an external sia transceiver is required to complete the interface to the media. this functionality is implemented in the mc68160 enhanced ethernet serial transceiver (eest ? ). the mc68160 eest supports connections to the attachment unit interface (aui) or twisted-pair ethernet formats and pro- vides a glueless interface to the quicc32. figure d-2. ethernet lan capability figure d-3 shows how up to six of the serial channels can connect to a tdm interface. the quicc32 provides a built-in time-slot assigner for access to the tdm time slots. other chan- nels can work with their own set of pins, allowing possibilities like an ethernet to t1 bridge, etc. in an addition to this the qmc microcode emulates up to 32 channels within one scc. the quicc32 can terminate all time slots in a t1 or e1/cept line quicc32 quicc32 quicc32 scc1 ethernet scc1 scc1 mc68160 eest mc68160 eest mc68160 eest hub
mc68mh360 product brief d-6 mc68360 user? manual motorola figure d-3. serial channel to tdm bus implementation figure d-4 shows that the quicc32 time-slot assigner can support two tdm buses. each tdm bus can be of a different format?or example, one tdm can be a t1 line, and one can be a cept line. also this technique could be used to bridge frames from basic rate isdn to a t1/cept line, etc. the quicc32 can route channels to and from the qmc protocol to the two different tdm buses in any combination. figure d-4. dual tdm bus implementation figure d-5 shows a tdm application having one line termination device that extracts clocks and frame sychronization pulses. for t1/e1 line termination, devices exist that perform this function. alternatively, this can be achieved by a dsp from the motorola 56k family. for line termination the quicc32 is capable of handling up to 32 channels and it may be sufficient to omit the block labeled ?ther pcm line devices? if it is desired to incorporate other pcm line devices in the system as shown in figure d-5, the quicc32 can provide strobe signals to other devices that do not have a built-in time slot assigner. quicc time division multiplexed bus t1, cept, idl, gci, isdn, primary rate, user-defined time slot assigner scc scc scc scc smc smc any combination of sccs and smcs may be connected to the tdm. note: independent receive and transmit clocking, routing, and syncs are supported. quicc time slot assigner scc scc scc scc smc smc any combination of sccs and smcs may be connected to any tdm. tdm bus 1 tdm bus 2 note: two tdm buses may be simultaneously supported with the time slot assigner. (e.g. 32 channels hdlc (e.g. isdn basic rate with remaining scc? and smc?
mc68mh360 product brief motorola mc68360 user? manual d-7 figure d-5 shows the line interface unit, liu, being the master and providing the quicc32 with clocks. it is also possible to let the quicc32 be the master and provide clocks and syn- chronization pulses through its baud rate generators, both to itself and other devices on the tdm bus. d.2.4 the qmc microcode the standard quicc can handle one logical channel performing the protocol framework for each of its serial channels. this logical channel can be used in time division multiplexed interfaces as described above. the qmc protocol emulates up to 32 serial controllers that can operate in either hdlc mode or transparent mode within one single scc. the qmc microcode is rom based and in order to create enough memory space, the quicc32 has the centronics and bisync protocols removed. the quicc32 has the internal dual-port ram enlarged by 192 bytes to accommodate the parameters used by the qmc microcode. the standard quicc housed all the buffer descriptor table in internal ram and the actual data areas in either internal or external ram. the quicc32 needs an area in external mem- ory for its buffer descriptor. this reserved memory area shall start at an address on a 64 k boundary. the data buffers have to reside in external main memory. see figure d-6 for memory partitioning. figure d-5. tdm connections other pcm line devices liu other system functions rx and tx clocks and frame synchronization rx tx quicc32
mc68mh360 product brief d-8 mc68360 user? manual motorola d.2.5 data flow in a time slot environment like t1/e1, every slot occupies 8 consecutive bits creating a basic channel speed of 64 kbit/s. the number of time slots vary depending upon what interface will be used. the quicc32 can support up to 32 time slots with up to 8 bits, each giving a total throughput of 2.048 mbit/s for the qmc protocol in a e1 or cept interface. through the si ram, the user programs either to route the whole serial stream to the scc dedicated to qmc or use the si ram to gate only the designated time slots to the scc. in this later case other serial channels in the quicc32 can be multiplexed to the same physical interface through the si ram routing. external devices can also be used in designated time slots as long as they do not collide with the internal quicc32 channels. any logical channel can be spread over several time slots creating super channels. the maximum configuration is to concatenate all 32 time slots into one 2,048 mbit/s channel. sub channels are achieved by masking out any combination of the 8 bits in every time slot. the resulting channel speed is n x 8 kbit/s {n= 1....8}. the physical interface from the quicc32 is routed through the time slot assigner. each log- ical channel can work in full duplex mode but does not have to be routed to the same receiver and transmitter time slot. this is how the standard quicc operates today with each of the scc and smc channels. the quicc32 can have independent receive and transmit clocks as well as frame synchronization signals. all receive and transmit channels within the qmc will have the same clock. for diagnostic purpose each logical channel has a local loopback option. the whole incom- ing tdm frame can be selected to operate in global echo mode. for these diagnostic modes the clock and synchronization signals must be common for the receiver and transmitter. d.2.6 data management time slots are numbered 0 - 31, and each time slot is 8 bits long. the parameter ram is divided into a global section and a channel specific section. in the global section the channel routing is described in two tables, one for transmission and one for reception. this allows the user to connect the physical time slots to logical channels in any order desired and also mask for sub channels or to concatenate for super channels. whatever combination is cho- sen, the maximum number of supported transmit channels is 32 and the maximum number of supported receive channels is 32. for each logical channel there is a channel specific area in the dp ram that governs the data flow. for each channel the user can choose if data is transparent or is framed with the hdlc protocol, and what checksum algorithm is used. these two areas in the dp ram occupy the whole space. therefore the buffer descriptors for each logical channel have been moved out into the main memory. the buffer descriptors for all other protocols remain unchanged in internal memory. depending on how many qmc channels are used, the space for buffer descriptors in the dual-port memory may vary.
mc68mh360 product brief motorola mc68360 user? manual d-9 . figure d-6. fqmc memory map d.2.7 performance the quicc32 with the qmc protocol is designed to handle data rates from 8 kbps to 2.048 mbps. the qmc can support up to 32 channels. these are the outer boundaries. the user is free to program channel routing in the qmc and the si ram to create any other tdm system. beside the support for qmc, the remaining scc channels in the quicc32 can, in the 25 mhz version, support a data rate of 64 kbps each with any protocol framework. these remaining channels can be used independently or also multiplexed through the si ram. the 33 mhz version of quicc32 can support one ethernet channel with 32 qmc channels. a more detailed performance table will be provided at a later date. channel 0 parameter channel 1 parameter channel j parameter rbase tbase mcbase dpr memory structure for multichannel controller channel j tx bd table table channel j rx bd external memory 64k parameter ram page 1 parameter ram page 2 parameter ram page 3 parameter ram page 4
mc68mh360 product brief d-10 mc68360 user? manual motorola d.2.8 development support no new development tools will be needed for the quicc32. only the replacement of actual silicon is needed. all motorola and third party support tools will work as before. motorola will provide simple device drivers for developers to have an easy start on the software. d.2.9 ordering information the following table identifies the packages and operating frequencies available for the mc68mh360. the documents listed in the following table contain detailed information on the mc68360. these documents may be obtained from the literature distribution centers at the addresses listed at the bottom of this page. table d-1. mc68mh360 package/frequency availability package type v cc frequency (mhz) temperature order number quad flat pack (fe suffix) quad flat pack (cfe suffix) 5 v 0?5 0?5 0 c to 70 c ?0 c to +85 c mc68mh360fe25 mc68mh360cfe25 pin grid array (rc suffix) pin grid array (crc suffix) 5 v 0?5 0?5 0 c to 70 c ?0 c to +85 c mc68mh360rc25 mc68mh360crc25 quad flat pack (fe suffix 5 v 0?3 0 c to 70 c mc68mh360fe33 pin grid array (rc suffix) 5 v 0?3 0 c to 70 c mc68mh360rc33 quad flat pack (fe suffix 3.3 v 0?5 0 c to 70 c mc68mh360fe25v pin grid array (rc suffix) 3.3 v 0?5 0 c to 70 c mc68mh360rc25v table d-2. documentation document title order number contents mc68mh360 specification addendum contact local field sales office preliminary design information m68000 family programmer's reference manual m68000pm/ad m68000 family instruction set the 68k source br729/d independent vendor listing supporting soft- ware and development tools
motorola mc68356 user? manual index-1 index a a/d converters 7-312 a/d field 5-68 a/d register 5-70, 5-71 a26?0 2-1 a31?28 2-1 accessing the hdlc bus 7-192 achieving synchronization in transparent mode 7-223 ack 7-333 address ethernet address recognition 7-252 address bus 2-1 address error exception 5-42, 5-46 address multiplexing 6-58 address register 5-6, 5-7 address strobe 4-4 adi b-9 a-line 5-44, 5-56, 5-59 alternate function code 5-6 amux 2-7, 2-9, 6-48, 6-49 appletalk 1-10, 7-116, 7-117, 7-170, 7-196 appletalk controller 7-196 appletalk memory map and programming model 7-198 connecting the quicc to localtalk 7- 199 gsmr programming 7-199 hdlc frames 7-196 localtalk 7-196 localtalk frame format 7-197 psmr programming 7-200 quicc appletalk hardware connection 7-198 appletalk controller 7-196 appletalk memory map and programming model 7-198 applications 9-1 arbitration level 6-33 arbitration synchronous timing mode 6-31 architectural approach 1-6 architecture overview 1-4 as 2-8, 2-13, 4-3, 6-30, 6-63, 7-41, 7-44, 7- 58 asynchronous 4-20 asynchronous protocols 7-134 atemp 5-62, 5-72 auto baud 7-166 auto buffer 7-34 auto buffer example 7-56 autovector 4-6, 4-38 avec 2-8, 4-6, 4-38, 4-41, 6-8, 6-26, 6-48 aveco 6-26, 6-48 avr 6-34 b b0 5-49, 5-51, 5-52, 5-53, 5-54, 5-57 b1 5-49, 5-51, 5-53 background 5-14, 5-26, 5-34 background processing state 5-59 bank parity 6-62 base address 3-1 bclri 4-58, 6-25, 6-33 bclriid 6-25 bclro 2-9, 2-10, 6-25, 6-31, 6-33, 7-44, 7- 51, 7-58 bcr 7-31 bdle 7-204 bdle-bisync dle register 7-208 berr 2-10, 4-5, 4-20, 4-41, 7-51 berr signal 5-40 bg 2-9, 2-10, 4-49, 4-53, 6-26, 6-31, 6-32, 7-44 bgack 2-9, 4-49, 6-26, 6-31, 7-44 bgnd 5-60, 5-61, 5-62 bidirectional centronics 7-331 big-endian 7-126, 7-321 bisync 7-114, 7-115, 7-200 bisync channel frame reception 7- 202 thi d t t d ith f m k 4 0 4
index index-2 mc68356 user? manual motorola bisync channel frame transmission 7-201 bisync command set 7-204 bisync control character recognition 7-206 bisync controller 7-200 bisync frames 7-200 bisync memory map 7-203 data length 7-213 error-handling 7-209 lrc 7-210 nibblesync 7-201 parity 7-211 programming the bisync controller 7- 217 reverse data 7-211 scc bisync example 7-218 sum check 7-210 transmitting and receiving 7-208 bisync channel frame reception 7-202 bisync channel frame transmission 7- 201 bisync command set 7-204 bisync control character recognition 7- 206 bisync controller 7-200 bisync frames 7-200 bisync memory map 7-203 bisync receive buffer descriptor 7-212 bisync transmit buffer descriptor 7-213 bit manipulation instructions 5-23 bit manipulation timing table 5-97 bkar 6-44 bkcr 6-44 bkpt 2-11, 4-31 bkpt instruction 5-61 bkpt signal 5-60, 5-63, 5-66, 5-67 bkpt_tag 5-68 bkpto 6-26 br 2-9, 2-10, 4-49, 4-52, 6-26, 6-31, 6-32, 6-56, 6-70, 7-44, 9-12, 9-50 br040id 6-30 break 7-166 break support 7-151 breakpoint 4-31 breakpoint exception 5-39, 5-42, 5-43 breakpoint exception 5-49 breakpoint instruction 5-59 breakpoint instruction 5-26, 5-43 breakpoint logic 6-20 brg 7-86, 7-101 brgc 7-106 brgclk 6-17, 7-104, 7-314 brgo 7-101, 7-108, 7-364 broadcast address 7-257 bstm 6-30, 6-68 bsync 7-204 bsync-bisync sync register 7-207 buffer auto buffer 7-34 bisync receive buffer descriptor 7- 212 bisync transmit buffer descriptor 7- 213 buffer chaining 7-34 cp 7-123 ethernet receive buffer descriptor 7- 258 ethernet transmit buffer descriptor 7- 261 hdlc receive buffer descriptor 7-179 hdlc transmit buffer descriptor 7-183 pip 7-341 scc bufer descriptors 7-122 single buffer 7-34 smc transparent receive buffer descriptor 7-299 smc transparent transmit buffer descriptor 7-300 smc uart receiver buffer descriptor 7-283 smc uart transmit buffer descriptor 7-286 spi buffer descriptor ring 7-324 spi receive buffer descriptor 7-324 spi transmit buffer descriptor 7-326 transfer receive buffer descriptor 7- 228 transparent transmit buffer descriptor 7-230 uart receiver buffer descriptor 7-159 uart transmit buffer descriptor 7-163 buffer chaining 7-34 buffer descriptors 7-10
index motorola mc68356 user? manual index-3 burst 6-72, 6-77, 6-78 burst access support 6-61 burst eprom 9-38 burst length 6-76 burst sram 9-41 bus address bus 2-1 arbitration synchronous timing mode 6- 31 asynchronous 4-20 autovector 4-38 breakpoint 4-31 bus error 4-5, 4-43 bus exception 4-41 byte port 4-12 data bus 2-5 double bus fault 4-48 double bus fault monitor 6-9 dynamic bus sizing 4-6, 4-19 fast termination 4-21 halt termination 4-41 imb 1-4, 10 intermodule bus 1-4, 10 internal accesses 4-59 interrupt acknowledge 4-36 lpstop 4-35 misaligned operands 4-11 normal termination 4-41 port sizes 4-8 read cycle 4-23 read-modify-write 4-28 retry 4-44 retry termination 4-41 show cycles 4-62 spurious interrupt 4-41 state diagram 4-55 synchronous 4-21 system bus 2-1, 4-1 wait states 4-26, 4-28 word port 4-9, 4-14 write cycle 4-26 bus arbitration 4-49, 4-55, 9-35 bus clear 6-25 bus control signals 2-7 bus controller 5-83 bus error 4-5, 4-43 bus error exception 5-40 bus exceptions 4-41, 4-59, 7-51 bus monitor 6-4, 6-8 bus operation 4-1 bus signal 2-1 busy signal 7-335 byte port 4-12 c c/i channel 7-307 c/i channel receive buffer descriptor 7- 310 c/i channel transmit buffer descriptor 7- 311 cache modes on the mc68ec040 9-51 caching 9-36 calculate effective address timing table 5- 91 call 5-70 call command 5-63 cam interface 7-243 carrier sense 7-116 cas 2-7, 2-13, 6-48, 6-60, 6-63, 6-67 cascaded mode 7-19 ccitt i.460 7-97 cd 7-63, 7-101, 7-114, 7-118, 7-128, 7-129, 7-130, 7-187, 7-199, 7-219, 7-223, 7- 229, 7-233, 7-240, 7-266, 7-358 cdvcr 6-12, 6-42 centronics 1-13, 7-331, 7-336 cept 1-15, 14 change of flow 5-84, 5-85 changing privilege level 5-35 character length 7-282, 7-298 chip driver module b-2 chip selects 9-24 cicr 7-378 cimr 7-381 cipr 7-380 cisr 7-381 clk 2-10, 2-13, 7-86, 7-101 clk2 7-104 clk6 7-104 clko 2-10 clko power pins 6-19 clko1 6-18 clko2 6-18 clkocr 6-12, 6-39
index index-4 mc68356 user? manual motorola clock brgclk 6-17 clko 6-18 clko2 6-18 clock divider 7-107 clock glitch 7-139 clock synthesizer 9-14 external components 6-14 general system clock 6-16 glitch detect 7-139 low-power divider 6-15 oscillator 6-12 oscillator prescaler 6-13 pll 6-14 quicc internal clock signals 6-15 sim60 6-12 simclk 6-18 syncclk 6-17 clock 7-137 clock divider 7-107 clock edge 7-80 clock generation 6-12 clock glitch 7-139 clock synthesizer 9-14 clocking 9-34 clocking and pin functions 7-314 close rx bd 7-148, 7-176, 7-206, 7-227, 7-251, 7-280, 7-297, 7-323 cmar 7-33 cmr 7-28 code compatibility 5-5, 5-10 codec 7-91, 7-313 collision handling 7-254 command 7-148 close rx bd 7-148, 7-176, 7-206, 7- 227, 7-251, 7-280, 7-297, 7-323 command set 7-5 enter hunt command 7-176 enter hunt mode 7-205, 7-227, 7- 251, 7-280, 7-296, 7-297 graceful stop transmit 7-120, 7-148, 7-175, 7-205, 7-226, 7-250 init rx parameters 7-149, 7-176, 7-206, 7-280, 7-297, 7-323 init tx and rx parameters command 7-307 init tx parameters 7-148, 7-205, 7- 227, 7-251, 7-280, 7-297, 7-323 init_idma 7-38 opcodes 7-6 reset bcs calculation 7-205, 7- 218 restart transmit 7-120, 7-148, 7- 175, 7-205, 7-226, 7-251, 7-280, 7-297 send break 7-280 sending a preamble 7-280 set group address 7-251 spi 7-323 stop transmit 7-120, 7-147, 7-226, 7-250, 7-279, 7-297 stop transmit 7-175, 7-204 timeout 7-308 transmit abort request command 7-307 command execution latency 7-8 command format 5-68 command set 7-5 commands command execution latency 7-8 commands in gci mode 7-307 communication processor module 1-6, 7-1 companion mode 9-31 compatibility issues 1-7 compiler 9-18 condition code register 5-12, 5-17 condition test instructions 5-26 conditional branch instruction timing table 5-98 config 2-9, 2-12, 2-14 config0 2-9 config1 2-9 config1/bclro/ras2dd 6-49 config2 2-12 connecting the quicc to ethernet 7-239 connecting the quicc to localtalk 7-199 control instruction timing table 5-99 cp 7-123 cpic programming model 7-378 cpm 1-6, 7-1, 9-17 cpm block diagram 7-2 cpm interrupt controller 7-370 cpm sub-module base addresses 3-3 cpu space 4-31
index motorola mc68356 user? manual index-5 cpu32 1-5, 11 cpu32+ 5-1 core 1-5 instruction set 5-8 programming model 5-6 registers 5-7 dfc 5-7 program counter 5-7 sfc 5-7 status register 5-7 vector base register 5-7 serial logic 5-63, 5-65 cr 7-5 crc16 7-210 cs 2-10, 6-30, 6-48, 6-67, 6-71 cs0 6-25, 9-5 csma/cd 7-235 csnt40 6-73 csntq 6-73 csr 7-32 cts 7-63, 7-101, 7-114, 7-118, 7-120, 7- 128, 7-129, 7-130, 7-187, 7-190, 7- 192, 7-199, 7-219, 7-223, 7-233, 7- 240, 7-266, 7-358 current instruction program counter 5-58 cycle length 6-77 d d31?16 2-5 dack 7-28, 7-33, 7-39 dapr 7-31 data encoding 7-135 data length 7-213 data movement instructions 5-19 data registers 5-7 data strobe 4-4 dbcc instruction 5-3 dec 7-126 delayed rts mode 7-194 deriving swt timeout 6-36 deterministic opcode tracking 5-59, 5-60, 5-80 development tools and support b-1 dfc 4-36 dhr 7-33 differential biphase-l 7-118 differential manchester 7-118, 7-136 digital phase-locked loop (dpll) 7-135 disable cpu32+ 6-23 disabling the sccs 7-139 disabling the smcs on the fly 7-274 done 7-28, 7-33, 7-52 double bus fault 4-48, 5-40 double bus fault monitor 6-4, 6-9 double drive ras lines 6-63 dpll 7-117, 7-118 dpll error 7-182 dpll operation 7-136 dpll receive block diagram 7-137 dpll transmit block diagram 7-137 dprbase 3-2 dram banks 6-58 dram bus error 6-63 dram controller address multiplexing 6-58 bank parity 6-62 bus error 6-63 controller overview 6-58 devices 9-9, 9-46 normal access 6-60 overview 6-58 page size 6-65 port size 6-65 simm 9-8, 9-45 dram-sram performance summary 6- 78 external master support 6-63 global memory register 6-64 memory controller block diagram 6-53 option register 6-74 page mode 6-75 programming model 6-64 refresh 6-64 refresh cycle 6-64 refresh operation 6-62 dram controller overview 6-58 dram counter burst access support 6-61 double drive ras lines 6-63 page mode support 6-60 dram device 9-9, 9-46 dram normal access 6-60 dram page size 6-65 dram port size 6-65
index index-6 mc68356 user? manual motorola dram simm 9-8, 9-45 dram-sram performance summary 6-78 dreq 7-28, 7-33, 7-40 ds 2-8, 4-4, 6-30 dsack 2-8, 4-21, 4-41, 6-63, 6-65, 6-67, 7- 43 dsclk 2-11, 5-63 dsi 2-11, 5-63 dso 2-11, 5-65, 5-66 dsr 7-121 dual address destination write 7-46 dual address mode 7-45 dual address packing 7-46 dual address source read 7-45 dual address transfer 7-46 dual-port ram 7-8, 7-9, 9-15 , c-1 block diagram 7-9 cpm sub-module base addresses 3-3 memory map 3-2 parameter ram 7-10 scc buffer descriptors 7-122 scc memory structure 7-123 scc parameter ram 7-124 smc memory structure 7-270 smc parameter ram 7-270 smc parameter ram 7-270 transparent memory map 7-225 dump memory block 5-70, 5-75 dynamic bus sizing 4-6, 4-19 dynamic changes 7-140 e edx b-1, b-4 eeprom 1-12, 7-312, 9-7, 9-45 eest ? 1-9, 13, 7-236 effects of wait states on instruction timing 5-86 enhanced ethernet serial transceiver 1-9, 13 enter hunt mode 7-148, 7-176, 7-205, 7-227, 7-251, 7-280, 7-296, 7-297 eprom 9-5, 9-38 error stack frames 5-56, 5-57 error-handling 7-154, 7-209 error-handling procedure 7-255 ethernet 7-114, 7-116, 7-117, 7-178, a-1 broadcast address 7-257 cam interface 7-243 collision handling 7-254 connecting quicc to ethernet 7-239 connecting the quicc to ethernet 7- 240 eest 7-236 error-handling procedure 7-255 ethernet address recognition flowchart 7-253 ethernet block diagram 7-237 ethernet channel frame reception 7- 242 ethernet channel frame transmission 7-241 ethernet controller 7-235 ethernet memory map 7-246 ethernet on quicc 7-236 ethernet programming model 7-250 ethernet/802.3 frame format 7-235 first-time user 7-238 hash table algorithm 7-253 heartbeat 7-257, 7-263 internal and external loopback 7-255 interpacket gap time 7-254 late collision 7-263 learning ethernet on the quicc 7-238 mc68160 7-236 nonoctet aligned 7-261 pb15?b8 pins 7-243 promiscuous 7-257 retry count 7-263 sample one byte 7-243 scc ethernet example 7-266 serial cam interface 7-244 short frame 7-261 short frame padding 7-262 sia 7-236 tag byte 7-245, 7-258 tcp/ip 7-235 ethernet address recognition 7-252 ethernet address recognition flowchart 7- 253 ethernet block diagram 7-237 ethernet channel frame reception 7-242 ethernet channel frame transmission 7- 241 ethernet command set 7-250
index motorola mc68356 user? manual index-7 ethernet controller 7-235 ethernet memory map 7-246 ethernet on quicc 7-236 ethernet programming model 7-250 ethernet receive buffer descriptor 7-258 ethernet transmit buffer descriptor 7-261 evt 9-16 exception bus exception 4-41 exception handler 5-34, 5-39, 5-46, 5-47, 5- 49, 5-51, 5-52, 5-53, 5-54, 5-55 exception priorities 5-38 exception processing 5-34, 5-39, 5-46 exception processing 5-36, 5-38, 5-39, 5- 41, 5-43, 5-47, 5-52, 5-57, 5-82 exception vectors 5-36, 5-43, 5-59 extal 2-11 external burst requests 7-40 external bus interface control 6-21 external bus masters 9-18 external components 6-14 external cycle steal 7-42 external exception 5-36 external master support 6-63 external master wait state 6-67 external sync 7-115 external synchronization signals 7-223 f fast termination 4-21 fast-termination option 7-50 fault address register 5-63 fault correction 5-63 fault types 5-51, 5-52 fc 2-5 fc3?c0 4-3 fcr 7-31 fetch effective address timing table 5-90 fifo 7-3, 7-179, 7-209 fifo latency 7-114 fifo length 7-114 fifo width 7-114 fill memory block 5-76 first-time user 7-238 flag status 7-186 flash eprom 9-5, 9-41 f-line instructions 5-44 fm0 7-116, 7-118, 7-136, 7-197 fm1 7-116, 7-118, 7-136 force_bgnd 5-67 format error exception 5-43, 5-48 four-word stack frame 5-56 fractional stop bits 7-153 frame sync delay 7-81 frames threshold 7-174 freeze 5-62, 5-66, 6-31, 7-60 freeze 2-12 freeze support 6-11 frequency multiplication 6-14 function codes 2-5, 4-3 g gaddr 7-249 gci 7-80, 7-96, 7-268 smc 7-305 gci controller 7-305 gcidcl 7-97 general system clock 6-16 general-purpose chip-select overview 6- 56 general-purpose timers 7-17 glitch 7-185 glitch detect 7-112, 7-139 global (boot) chip-select 6-58 global chip select 6-25 global memory register 6-64 glueless system 1-8 gmr 6-56, 6-64, 9-11, 9-49 gnd 2-13 gndclk 6-19 gnds 2-13 gndsyn 2-13, 6-19 go 5-63, 5-70, 5-77 graceful stop transmit 7-120, 7- 148, 7-175, 7-205, 7-226, 7-250 grant support 7-86 grouped 7-380 gsmr 7-111 gsmr programming 7-196, 7-199 h haddr 7-173 halt 2-10, 4-20, 4-41, 4-46, 7-44, 7-51, 7-
index index-8 mc68356 user? manual motorola 58 halt termination 4-41 hardware breakpoint 5-37, 5-39, 5-43, 5-56 hash table algorithm 7-253 hdlc 7-114, 7-116, 7-169, 7-178, a-1 dpll error 7-182 fifo 7-177, 7-179 flag status 7-186 frames threshold 7-174 glitch 7-185 hdlc address recognition example 7- 174 hdlc channel frame reception processing 7-172 hdlc channel frame transmission processing 7-171 hdlc command set 7-175 hdlc controller 7-169 hdlc error-handling 7-176 hdlc example 7-187 hdlc framing structure 7-171 hdlc memory map 7-172 hdlc programming model 7-174 hdlc rx bd 7-180 idle sequence status 7-186 nonoctet aligned 7-177 hdlc address recognition example 7-174 hdlc bus 7-178 accessing the hdlc bus 7-192 delayed rts mode 7-194 gsmr programming 7-196 hdlc bus controller 7-189 hdlc bus controller example 7-196 hdlc bus key features 7-192 hdlc bus memory map and programming 7-196 hdlc bus multi-master configuration 7- 191 hdlc bus single-master configuration 7-191 non-symmetrical duty cycle 7-193 psmr programming 7-196 t1.605 7-190 transmission line configuration 7-194 tsa transmission line configuration 7- 195 hdlc bus 1-10, 7-189, a-2 hdlc bus collision detection 7-193 hdlc bus controller 7-189 hdlc bus controller example 7-196 hdlc bus key features 7-192 hdlc bus memory map and programming 7-196 hdlc bus multi-master configuration 7- 191 hdlc bus single-master configuration 7- 191 hdlc channel frame reception processing 7-172 hdlc channel frame transmission processing 7-171 hdlc command set 7-175 hdlc controller 7-169 hdlc error-handling 7-176 hdlc example 7-187 hdlc frames 7-196 hdlc interrupt 7-185 hdlc memory map 7-172 hdlc programming model 7-174 hdlc receive buffer descriptor 7-179 hdlc rx bd 7-180 hdlc transmit buffer descriptor 7-183 heartbeat 7-257, 7-263 highest priority 7-380 hmask 7-173 i i/o pins 7-333 iack 2-7, 2-8, 6-48 iack5 4-39 iaddr 7-250 iccr 7-26 idl 7-80, 7-90, 7-268 idl interface example 7-91 idl interface programming 7-95 idle sequence status 7-186 idle status 7-167 idma 6-31, 7-59 idma (independent dma controller external cycle steal 7-42 idma controllers 7-24 idma (independent dma controller) 7-35, 7-36 auto buffer example 7-56
index motorola mc68356 user? manual index-9 dual address destination write 7-46 dual address mode 7-45 dual address packing 7-46 dual address source read 7-45 dual address transfer example 7-46 external burst requests 7-40 external cycle steal 7-42 fast-termination option 7-50 idma bus arbitration 7-43 idma channels 7-24 idma controller block diagram 7-25 idma examples 7-55 idma operand transfers 7-45 requesting idma transfers 7-39 single address mode 7-48 single address transfer 7-48 idma bus arbitration (normal operation) 7- 44 idma buffer descriptors 7-36 idma bus arbitration 7-43, 7-44 idma channels 7-24 idma controller block diagram 7-25 idma controllers 7-24 idma examples 7-55 idma operand transfers 7-45 idma registers 7-26 ieee 802.3 7-235 ifetch 2-11, 5-60, 5-63, 5-80, 5-82 imb 1-4, 10 immediate arithmetic/logic instruction table 5-95 in 5-49, 5-50, 5-52 init rx parameters 7-149, 7-176, 7- 206, 7-227, 7-251, 7-297, 7-323 init rx parameters 7-280 init tx and rx parameters command 7-307 init tx parameters 7-148, 7-205, 7- 227, 7-251, 7-280, 7-297, 7-323 init_idma 7-38 initialization 9-10 in-line synchronization pattern 7-223 instruction execution overlap 5-85, 5-86 instruction execution time calculation 5-86 instruction pipeline operation 5-85 intel 7-126, 7-272, 7-321 interface multiple quiccs to an mc68ec040 9-51 interface signals 7-33 interlocked data transfers 7-333 intermodule bus 1-4, 10 internal accesses 4-59 internal and external loopback 7-255 internal exceptions 5-36 internal memory 3-1 internal registers memory map 3-4 interpacket gap time 7-254 interrupt 6-26, 7-370, 9-16, 9-23, 9-34 autovector 4-6, 4-38 cpm interrupt controller 7-370 grouped 7-380 hdlc interrupt 7-185 highest priority 7-380 interrupt acknowledge 4-36 interrupt arbitration 6-8, 6-33 interrupt handler examples 7-382 interrupt in-service register 7-381 interrupt mask register 7-381 interrupt pending register 7-380 interrupt service mask 6-33 interrupt source priorities 7-373 interrupt vector 6-8 interrupt vector generation 7-376 interrupts from the sccs 7-128 irqx 7-379 masking interrupt sources 7-375 nested interrupts 7-374 periodic interrupt request level encoding 6-37 quicc interrupt structure 7-372 rxf interrupt 7-174 scc interrupt handling 7-130 slave mode 6-26 smc interrupt handling 7-305 smc uart 7-289 spread 7-380 spurious interrupt 4-41 uart interrupt events example 7-165 vector base address 7-380 interrupt acknowledge 4-36 interrupt arbitration 6-8, 6-33 interrupt exceptions 5-38 interrupt generation 6-6 interrupt handler examples 7-382
index index-10 mc68356 user? manual motorola interrupt handling 7-291, 7-331 interrupt in-service register 7-381 interrupt level 7-371 interrupt mask register 7-381 interrupt pending register 7-380 interrupt service mask 6-33 interrupt source priorities 7-373 interrupt structure 6-7 interrupt vector 6-8 interrupt vector generation 7-376 interrupts from the sccs 7-128 inverted hdlc 7-116 iom-2 7-268 iout 6-49 iout2?out0 6-26 ipend 9-35 ipipe 2-11, 2-13, 5-60, 5-63, 5-80, 5-82, 6- 49 irq 2-7, 6-26, 7-379 irq1 6-49 isdn 7-178 devices 7-312 j jitter 7-115 l l1clkox 7-96 l1grx 7-93 l1rclkx 7-93, 7-96 l1rqx 7-79, 7-93 l1rsyncx 7-80, 7-93, 7-96 l1rxd 7-73, 7-269 l1rxdx 7-93, 7-96 l1sta1 7-73 l1stb1 7-73 l1txd 7-73, 7-269 l1txdx 7-93, 7-96 lapb 7-170, a-1, b-1, b-3 lapd 7-170, a-1, b-1, b-3 larger quicc system 1-9 late collision 7-263 learning ethernet on the quicc 7-238 line fill 6-78 little-endian 7-126, 7-272, 7-321 localtalk 1-10, 7-117, 7-196 localtalk frame format 7-197 low power in normal operation 6-12 low-power divider 6-15 low-power stop 6-11 lpstop 4-35 lrc 7-210 m m68000 code 9-18 m68360 quads development system b-6 m68hc05 7-312 m68hc11 7-312 manchester 7-118, 7-136, 7-235 masking interrupt sources 7-375 master 7-314 master mode 7-315 master-slave quicc 1-17 max_idl 7-145, 7-277 maxd1 7-249 maxd2 7-249 mbar 3-1, 3-2, 4-36, 6-1, 6-3, 6-24, 6-27, 9- 14 mbare 6-25, 6-29 mc145554 7-313 mc68030 4-1, 6-23 mc68030-type 6-54 mc68040 6-66, 6-77, 9-31 br040id 6-30 burst 6-77, 6-78 burst length 6-76 bursts 6-72 line fill 6-78 mc68040 companion mode 1-5, 1-18, 6- 23, 12 mc68160 1-9, 7-236, 13 mc68195 1-10 mc68195 localtalk adaptor 7-197 mc68302 1-1, 1-6, 9-18 mc68332 1-7 mc68340 1-6, 4-1, 12 mc68360 1-1 mc68605 a-1 mc68606 a-1 mc68ec040 1-18, 4-1, 6-30, 6-52, 9-31 mc68ec040 to quicc interface 9-32, 9-33 mc68hc11 1-12 mcm36100s 9-8, 9-45
index motorola mc68356 user? manual index-11 mcm54260 9-9, 9-46 mcm62940a 9-41 mcr 6-29, 9-10 memory controller 6-50 memory controller block diagram 6-53 memory interfaces 9-4, 9-37 memory map 3-2 mflr 7-173, 7-248 microbus controller 5-83 microcode 7-4, c-1 microcode revision number 7-5 microsequencer operation 5-85 minflr 7-248 minimum quicc system 1-8 minimum system configuration 9-1 misaligned accesses 5-1 misaligned operands 4-11 misc base 3-3 modck 2-11 modck1?odck0 6-19 monitor channel 7-309 monitor channel reception 7-307 monitor channel transmission 7-306 mono-sync 7-115 motorola byte ordering 7-126, 7-272, 7-321 motorola mode 7-126 motorola software modules b-1 move instruction timing table 5-92 movem faults 5-49, 5-51, 5-52 movep faults 5-51 mrblr 7-127, 7-273, 7-322 mstat 6-56, 6-69 multidrop mode 7-149 multiprocessor system 5-57 n nc 2-10, 2-13 nested interrupts 7-374 nibblesync 7-201 nmarc 7-174 nmsi 7-62, 7-117, 7-269 brgox 7-101 nonoctet aligned 7-177, 7-261 non-symmetrical duty cycle 7-193 normal asynchronous mode 7-143 normal termination 4-41 nrz 7-118, 7-135 nrzi 7-118 nrzi mark 7-116, 7-135 nrzi space 7-116, 7-135 o oe 2-9, 4-4, 6-48, 6-49 on-the-fly changes 7-140 opcode tracking in loop mode 5-59 open-drain 7-358 operand faults 5-52 operation field 5-68 option register 6-74 or 6-56, 9-12, 9-50 oscillator 6-12 oscillator prescaler 6-13 output enable 4-4 p p1284 7-331 padat 7-360 paddr 7-249 padir 7-360 pads 7-248 page mode 6-75 page mode support 6-60 paodr 7-360 parallel i/o 7-129, 7-358 parallel i/o port port a 7-359 port a examples 7-361 port a registers 7-360 port b example 7-366 port b pin functions 7-363 port c registers 7-368 port d 6-22 parallel interface 1-13 parallel interface port 7-331 parameter ram 7-10 parity 6-57, 6-68, 6-70, 6-71, 7-211 parity enable 7-159 pb15?b8 pins 7-243 pbdat 7-357, 7-365 pbdir 7-357, 7-365 pbodr 7-358, 7-365 pbpar 7-357 pcdat 7-369
index index-12 mc68356 user? manual motorola pcdir 7-369 pcpar 7-369 pcso 7-369 pepar 6-48, 9-11, 9-15, 9-49 periodic interrupt request level encoding 6-37 periodic interrupt timer 6-5, 6-10 picr 6-37 pin differences 6-26 pip 7-332, 7-338, 7-341, 7-364 busy signal 7-335 centronics 7-336 i/o pins 7-333 interlocked data transfers 7-333 parallel interface port 7-331 pip block diagram 7-332 port b 7-333 port b pin functions 7-363 port b registers 7-357, 7-365 port e 6-23 programming model 7-338 pulse data transfers 7-334 pulsed handshake timing 7-336 pip block diagram 7-332 pipc 7-339 pipe 7-341 pipm 7-342 pit 6-10 pitr 6-38 pll 6-14 pll power pins 6-19 pllcr 6-12, 6-40 port a 7-359 port a examples 7-361 port a registers 7-360 port b 7-333 port b example 7-366 port b pin functions 7-363 port b registers 7-357, 7-365 port c registers 7-368 port d 6-22 port e 6-23 port sizes 4-8 postincrement 5-5, 5-12 power-on reset 9-3 predecrement 5-5, 5-12 prefetch controller 5-84 prefetch faults 5-51 priority of the risc 7-3 privilege violation 5-56 profibus c-6 profibus 7-142 program control instructions 5-24 program counter 5-2, 5-56, 5-58, 9-13 programmer's model 6-27 programming model 6-64, 7-317, 7-338 programming si ram entries 7-72 programming the bisync controller 7-217 promiscuous 7-220, 7-257 prty 2-6 psmr 7-120, 7-156, 7-175, 7-178, 7-210, 7- 228, 7-256 psmr programming 7-196, 7-200 ptpr 7-341 pulse data transfers 7-334 pulsed handshake timing 7-336 q q.921 a-1 quad integrated communication controller 1-1, 9 quads b-6 quicc appletalk hardware connection 7- 198 quicc block diagram 1-4, 11 quicc ethernet serial cam interface 7- 244 quicc functional signal groups 2-2 quicc internal clock signals 6-15 quicc interrupt structure 7-372 quicc key features 1-1 quicc memory map 3-1, 3-2, 6-4 quicc system configuration 6-55 r r/w 4-3 r/w field 5-68 ra 2-10 ram dram banks 6-58 si ram 7-68 spi parameter ram memory map 7-320 sram banks 6-56
index motorola mc68356 user? manual index-13 ram microcode 7-4, 7-10, 7-235 ras 2-6, 6-30, 6-60, 6-63, 6-64, 6-65 ras1dd 2-6, 2-11 ras2 2-10 ras2dd 2-9, 6-25, 6-49 rbase 7-125, 7-271, 7-320 rbptr 7-127, 7-273, 7-322 rccm 7-204 rccr 7-4 rclk 7-101 read a/d register 5-71 read cycle 4-23 read memory location 5-73 read system register command 5-62 read-modify-write 4-28 read-modify-write cycle 5-50 read-modify-write faults 5-51 real-time clock 7-312 receiver 7-275 receiver shortcut 7-276 refresh 6-64 refresh cycle 6-64 refresh operation 6-62 register field 5-69 register map 3-1 registers 3-1 avr 6-34 bcr 7-31 bdle 7-204 bdle-bisync dle register 7-208 bkar 6-44 bkcr 6-44 br 6-56, 6-70 brgc 7-106 bsync 7-204 bsync-bisync sync register 7-207 cdvcr 6-12, 6-42 cicr 7-378 cimr 7-381 cipr 7-380 cisr 7-381 clkocr 6-12, 6-39 cmar 7-33 cmr 7-28 cr 7-5 cs 6-71 csr 7-32 dapr 7-31 dfc 4-36 dhr 7-33 dprbase 3-2 dsr 7-121 fcr 7-31 gaddr 7-249 gmr 6-56, 6-64 gsmr 7-111 haddr 7-173 hmask 7-173 iack 6-48 iaddr 7-250 iccr 7-26 internal registers memory map 3-4 maxd1 7-249 maxd2 7-249 mbar 3-1, 3-2, 6-1, 6-3, 6-27 mbare 6-29 mcr 6-29 mflr 7-173, 7-248 minflr 7-248 mrblr 7-127, 7-273, 7-322 mstat 6-56, 6-69 nmarc 7-174 or 6-56 padat 7-360 paddr 7-249 padir 7-360, 7-365 pads 7-248 paodr 7-360 papar 7-361 pbdat 7-358, 7-365 pbdir 7-357 pbodr 7-358, 7-365 pbpar 7-357, 7-366 pcdat 7-369 pcdir 7-369 pcpar 7-369 pcso 7-369 pepar 6-48 pipc 7-339 pipe 7-341 pipm 7-342 pitr 6-38 pllcr 6-12, 6-40 psmr 7-120, 7-156, 7-175, 7-178, 7-
index index-14 mc68356 user? manual motorola 210, 7-228, 7-256 ptpr 7-341 rbase 7-125, 7-271, 7-320 rbptr 7-127, 7-274, 7-322, 7-323 rccm 7-204 ret_lim 7-248 rfcr 7-125, 7-272, 7-321 rfthr 7-174 rsr 6-34 rter 7-14 rtmr 7-14 sapr 7-30 scce 7-128, 7-164, 7-184, 7-216, 7- 232, 7-264 sccm 7-129, 7-186, 7-217, 7-233, 7- 265 sccs 7-129, 7-187, 7-217, 7-233, 7-265 sccs 7-167 sdar 7-61 sdcr 7-59 sdsr 7-61 sfc 4-36 sicmr 7-87 sicr 7-86 sigmr 7-77 simode 7-78 sirp 7-88 sistr 7-87 smce 7-288, 7-311 smcm 7-290 smcmr 7-270, 7-281, 7-298, 7-308 spcom 7-315, 7-319 spie 7-328 spim 7-329 swiv 6-35 swsr 6-39 sypcr 6-35 taddr 7-250 tbase 7-125, 7-271, 7-320 tbptr 7-127, 7-175, 7-274 tcn 7-22 tcr 7-22 ter 7-22 tfcr 7-125, 7-272, 7-321 tgcr 7-20 tmr 7-21 todr 7-121, 7-175, 7-200 trr 7-22 registers picr 6-37 released write 5-41 requesting idma transfers 7-39 reset 4-65, 6-25 instruction 5-35, 5-40, 5-70 bcs calculation 7-205, 7-218 signal 5-40 reset 4-63, 9-14 exception 5-39 peripherals 5-70, 5-79 power-on reset 9-3 status 6-3 strategy 9-34 value 3-5 reseth 2-10, 4-64 resets 2-10, 4-64 restart transmit 7-120, 7-148, 7-175, 7-205, 7-226, 7-251, 7-280, 7-297 ret_lim 7-248 retry 4-44 count 7-263 termination 4-41 return program counter 5-58, 5-63 returning from bdm 5-63 reverse data 7-112, 7-211 rfcr 7-125, 7-272, 7-321 rfthr 7-174 risc controller 7-3 risc microcode from ram c-1 risc processor c-1 risc timer initialization sequence 7-14 risc timer table application 7-16 risc timer tables 7-11 rm bit 5-50 rmc 2-9, 4-3, 4-28, 4-54 rqout 6-26, 6-49 rr bit 5-50 rrjct 7-244 rs-232 7-142 rsr 6-34 rsreg 5-70 rstrt 7-243 rte 5-16, 5-26, 5-50 rte instruction 5-53, 5-55 rter 7-14 rtmr 7-14
index motorola mc68356 user? manual index-15 rts 7-63, 7-101, 7-114, 7-119, 7-130, 7- 187, 7-219, 7-224, 7-233, 7-240, 7- 266, 7-358, 7-364 rw bit 5-50 rxd 7-101, 7-358 s s/t 7-96 s/t transceiver 7-91 sample one byte 7-243 sapr 7-30 save and restore operations timing table 5-101 saving power 7-141 scc 7-101, 7-109, a-1 asynchronous protocols 7-134 digital phase-locked loop (dpll) 7- 135 disabling the sccs 7-139 dynamic changes 7-140 fifos 7-3 on-the-fly changes 7-140 saving power 7-141 scc receiver full sequence 7-140 scc receiver shortcut sequence 7-141 scc transmitter full sequence 7-140 scc transmitter shortcut sequence 7- 140 switching protocols 7-141 syncclk 7-108 synchronous protocols 7-130 scc bisync example 7-218 scc block diagram 7-111 scc buffer descriptors 7-122 scc ethernet example 7-266 scc fifos 7-3 scc initialization 7-129 scc interrupt handling 7-130 scc memory structure 7-123 scc parameter ram 7-124 scc receiver full sequence 7-140 scc receiver shortcut sequence 7-141 scc timing control 7-130 scc transmitter full sequence 7-140 scc transmitter shortcut sequence 7-140 scc transparent example 7-233 scc uart example 7-167 scc uart rx bd example 7-160 scce 7-128, 7-164, 7-184, 7-216, 7-232, 7- 264 sccm 7-129, 7-167, 7-186, 7-217, 7-233, 7-265 sccs 7-129, 7-187, 7-217, 7-233, 7-265 sccs 7-167, 9-26 scit 7-81, 7-96, 7-98, 7-268 scit programming 7-98 scp 1-13, 7-93, 7-313 scsi 9-54 sdack 7-245 sdar 7-61 sdcr 7-59 sdlc 1-11, 7-170 sdma 6-31 sdma channel sdma data paths 7-58 sdma channels 7-57 sdma data paths 7-58 sdma registers 7-59 sdsr 7-61 send break 7-280 sending a preamble 7-153, 7-280 sending transparent frames between quiccs 7-225 serial communication controllers 7-109 serial interface 5-62, 5-63 serial interface with time slot assigner 7- 62 serial management controllers 7-268 serial performance a-1 serial peripheral interface 7-312 set group address 7-251 set timer 7-14 sfc 4-36 shadow ram 7-76, 7-87 short frame 7-261 short frame padding 7-262 show cycles 4-62 si 7-269 si (serial interface clock edge 7-80 shadow ram 7-76 strobes 7-88 si (serial interface) brg 7-86
index index-16 mc68356 user? manual motorola ccitt 1.460 7-97 clk 7-86 frame sync delay 7-81 gci 7-80, 7-96 gcidcl 7-97 grant support 7-86 idl 7-80, 7-90 idl interface example 7-91 idl interface programming 7-95 l1clkox 7-97 l1grx 7-93 l1rclkx 7-93, 7-96 l1rqx 7-79, 7-93 l1rsyncx 7-80, 7-93, 7-96 l1rxdx 7-73, 7-93, 7-96 l1sta1 7-73 l1stb1 7-73 l1txdx 7-73, 7-93, 7-96 programming si ram entries 7-72 s/t 7-96 scit 7-96, 7-98 scit programming 7-98 scp 7-93 shadow ram 7-87 si ram 7-68 si ram dynamic changes 7-75 si ram programming example 7-75 smc 7-99 spi 7-93 strobes 7-73 tsa 7-170 si gci programming 7-98 si gci support 7-96 si ram 7-68 si ram dynamic changes 7-75 si ram programming example 7-75 si registers 7-77 sia 7-236 sicmr 7-87 sicr 7-86 sigmr 7-77 signal 2-2 bus control signals 2-7 parity 2-6 signal descriptions 2-1 signals 4-64 16bm 2-6 a 6-48 a26?0 2-1 a31?28 2-1 ack 7-333 address bus 2-1 amux 2-7, 2-9, 6-48, 6-49 as 2-8, 2-13, 4-3, 6-30, 6-63, 7-41, 7-44, 7-58 avec 2-8, 4-6, 4-41, 6-26, 6-48 aveco 6-26, 6-48 bclri 4-58, 6-25, 6-33 bclriid 6-25 bclro 2-9, 2-10, 6-25, 6-31, 6-33, 7- 44, 7-51, 7-58 berr 2-10, 4-6, 4-20, 4-41, 7-51 bg 2-9, 2-10, 4-49, 4-53, 6-26, 6-31, 6- 32, 7-44 bgack 2-9, 4-49, 6-26, 6-31, 7-44 bkpt 2-11, 4-31 bkpto 6-26 br 2-9, 2-10, 4-49, 4-52, 6-26, 6-31, 6- 32, 7-44 brg 7-101 brgo 7-108, 7-364 busy signal 7-335 cas 2-7, 6-48, 6-60, 6-63, 6-67 casx 2-13 cd 7-63, 7-101, 7-114, 7-118, 7-128, 7- 129, 7-130, 7-187, 7-199, 7-219, 7-223, 7-229, 7-233, 7-240, 7- 266, 7-358 chip-select 2-6 clk 2-11, 2-13, 7-101 clk2 7-104 clk6 7-104 clko 2-10 clko power pins 6-19 config 2-9, 2-12, 2-14 config0 2-9 config1 2-9 config1/bclro/ras2dd 6-49 config2 2-12 cs 2-6, 2-10, 6-30, 6-48, 6-67 cs0 9-5 cso 6-25 cts 7-63, 7-101, 7-114, 7-118, 7-120, 7-128, 7-129, 7-130, 7-187, 7-
index motorola mc68356 user? manual index-17 190, 7-192, 7-199, 7-219, 7-223, 7-233, 7-240, 7-266, 7-358 d31?16 2-5 dack 7-28, 7-33, 7-39 done 7-28, 7-33, 7-52 double drive ras lines 6-63 dreq 7-28, 7-33, 7-40 ds 2-8, 4-4, 6-30 dsackx 2-8, 4-21, 4-41, 6-63, 6-65, 6- 67, 7-43 dsclk 2-11 dsi 2-11 dso 2-11 extal 2-11 fc 2-5 fc?c0 4-3 freeze 6-31, 7-60 freeze 2-12 function code 2-5 gnd 2-13 gndclk 6-19 gnds 2-13 gndsyn 2-13, 6-19 halt 2-10, 4-20, 4-41, 6-25, 7-44, 7-51, 7-58 iack 2-7, 2-8 iack5 4-39 ifetch 2-11 interface signals 7-33 iout2?out0 6-26 ipend 9-35 ipipe 2-11, 2-13, 6-49 irq1 6-49 irqx 2-7, 6-26, 7-379 l1clkox 7-97 l1grx 7-93 l1rclkx 7-93, 7-96 l1rqx 7-79, 7-93 l1rsyncx 7-80, 7-93 l1rxdx 7-73, 7-93, 7-96, 7-269 l1sta1 7-73 l1stb1 7-73 l1txdx 7-73, 7-93, 7-96, 7-269 mbare 6-25 modck 2-11 modck1?odck0 6-19 nc 2-10, 2-13 oe 2-9, 4-4, 6-48, 6-49 pll power pins 6-19 prty 2-6 quicc functional signal groups 2-2 r/w 4-3 ra 2-10, 6-66 ras 2-6, 6-30, 6-60, 6-63, 6-64, 6-65 ras1dd 2-6, 2-11 ras2 2-10 ras2dd 2-9, 6-25, 6-49 rclk 7-101 reset 6-25 reseth 2-10 resets 2-10, 4-64 rmc 2-9, 4-3, 4-28, 4-54 rqout 6-26, 6-49 rrjct 7-244 rstrt 7-243 rts 7-63, 7-101, 7-114, 7-119, 7-130, 7-187, 7-219, 7-224, 7-233, 7- 240, 7-266, 7-358, 7-364 rxd 7-101, 7-358 sdack 7-245 siz 2-8, 4-3, 4-8, 4-25 smclk 7-103, 7-269, 7-294 smrxd 7-103, 7-269 smsyn 7-269, 7-293 smtxd 7-103, 7-269 spiclk 7-315 spimiso 7-314, 7-315 spimosi 7-314 spisel 7-324, 7-326, 7-327 stb 7-333 stbi 7-333 stbo 7-333 ta 6-63, 9-32 tbi 9-32 tck 2-12 tclk 7-101 tdi 2-12 tdm 7-358 tdo 2-12 tgate 7-19 tin 7-18 tms 2-12 tout 7-18 tris 2-12, 6-26
index index-18 mc68356 user? manual motorola trst 2-12 ts 6-27, 6-60, 6-63, 6-68, 9-32 txd 7-101, 7-358 vcc 2-13 vccclk 6-19 vccsyn 2-13, 6-19 we 2-9, 4-27, 6-48 we3?e0 2-1 xfc 2-11, 6-19 xtal 2-10, 2-11 sim (system integration module) breakpoint logic 6-20 bus monitor 6-4, 6-8 clock generation 6-12 csnt40 6-73 csntq 6-73 double bus fault monitor 6-4 dram controller overview 6-58 external bus interface control 6-21 freeze support 6-11 general-purpose chip-select overview 6-56 interrupt generation 6-6 interrupt structure 6-7 low power in normal operation 6-12 low-power stop 6-11 mbar 6-1 memory controller 6-50 option register 6-74 periodic interrupt timer 6-5, 6-10 programming model 6-64 quicc internal clock signals 6-15 quicc memory map 6-4 quicc system configuration 6-55 reset status 6-3 sim40 6-1 simultaneous sim60 interrupt sources 6-8 slave (disable cpu32+) mode 6-23 software watchdog timer 6-5 spurious interrupt monitor 6-5, 6-8 system configuration 6-5 system configuration and protection 6-3 trlxq 6-74 sim40 6-1 sim60 1-5, 4-20, 6-1, 6-12 simclk 6-18 simode 7-78 simple driver module b-2 simultaneous sim60 interrupt sources 6-8 single address mode 7-48 single address transfer example 7-48 single buffer 7-34 sirp 7-88 sistr 7-87 siz 2-8, 4-3, 4-8, 4-25 slave 7-314 slave disable cpu32+) mode 6-23 slave mode 2-14, 7-316 br 9-50 burst eprom 9-38 burst sram 9-41 bus arbitration 4-55, 9-35 bus clear 6-25 bus exceptions 4-59 cache modes on the mc68ec040 9-51 disable cpu32+ 6-23 dram devices 9-46 dram simm 9-45 eeprom 9-45 eprom 9-38 flash eprom 9-41 global chip select 6-25 gmr 9-49 interfacing multiple quiccs to an mc68ec040 9-51 interrupts 6-26, 9-34 mc68ec040 to quicc interface 9-32 memory interfaces 9-37 or 9-50 pepar 9-49 pin differences 6-26 reset strategy 9-34 software configuration 9-48 sram 9-41 strategy 9-34 slave mode 6-26, 9-31 smc 7-99, 7-103, 7-276, 7-291, 7-305, a-2 c/i channel 7-307 c/i channel receive buffer descriptor 7-310 c/i channel transmit buffer 7-311 character length 7-282, 7-298 commands in gci mode 7-307
index motorola mc68356 user? manual index-19 disabling the smcs on the fly 7-274 enter hunt mode 7-296 gci 7-268 gci ?ontroller 7-305 idl 7-268 interrupt handling 7-291 iom-2 7-268 l1rxd 7-269 l1txd 7-269 max_idl 7-277 monitor channel 7-309 monitor channel reception 7-307 monitor channel transmission 7-306 nmsi 7-269 receiver 7-275 receiver shortcut 7-276 scit 7-268 si 7-269 smc gci mode register 7-308 smc memory structure 7-270 smc transparent nmsi example 7-303 smc uart memory map 7-277 smc uart mode register 7-281 smclk 7-269, 7-294 smcm 7-312 smrxd 7-269 smsyn 7-269, 7-293 smtxd 7-269 switching protocols 7-276 synchronization with the smsynx pin 7- 294 synchronization with the tsa 7-296 t1 7-268 tdm 7-268 transmitter 7-275 transmitter shortcut 7-275 transparent command set 7-297 transparent controller 7-291 transparent error-handling procedure 7-298 transparent protocol 7-268 transparent reception processing 7- 293 transparent transmission 7-292 transparent transmitter 7-292 transparent tsa example 7-304 uart 7-268, 7-276 uart command set 7-279 uart error-handling procedure 7-281 uart example 7-290 uart programming model 7-279 uart reception 7-279 uart rx bd example 7-286 uart transmitter 7-278 smc block diagram 7-269 smc buffer descriptors 7-270 smc gci mode register 7-308 smc interrupt handling 7-305 smc memory structure 7-270 smc parameter ram 7-270 smc transparent mode register 7-298 smc transparent receive buffer descriptor 7-299 smc transparent transmit buffer descriptor 7-300 smc uart 7-276, 7-289 smc uart memory map 7-277 smc uart mode register 7-281 smc uart receive buffer descriptor 7- 283 smc uart transmit buffer descriptor 7- 286 smce 7-288, 7-311 smclk 7-103, 7-269, 7-294 smcm 7-290, 7-312 smcmr 7-270, 7-281, 7-298, 7-308 smrxd 7-103, 7-269 smsyn 7-269, 7-293 smtxd 7-103, 7-269 snooping 9-36 software breakpoints 5-43 software compatibility 1-7 software configuration 9-10, 9-48 software test-drive 9-13 software watchdog timer 6-5, 6-9 spcom 7-315, 7-319 special status word 5-42, 5-48 special-purpose move instruction table 5- 92 spi 1-12, 1-13, 7-91, 7-93, 7-312, 7-323 clocking and pin functions 7-314 interrupt handling 7-331 master mode 7-315 programming model 7-317
index index-20 mc68356 user? manual motorola slave 7-314 slave mode 7-316 spi baud rate generator 7-314 spi block diagram 7-313 spi fifo 7-3 spi master example 7-329 spi mode register 7-317 spi slave example 7-330 spiclk 7-315 spimosi 7-314 spisel 7-324, 7-326, 7-327 start transmit 7-320 transfer format 7-319 transmit/receive 7-315 spi baud rate generator 7-314 spi block diagram 7-313 spi buffer descriptor ring 7-324 spi fifo 7-3 spi master example 7-329 spi mode register 7-317 spi parameter ram memory map 7-320 spi receive buffer descriptor 7-324 spi slave example 7-330 spi transmit buffer descriptor 7-326 spiclk 7-315 spie 7-328 spim 7-329 spimiso 7-314, 7-315 spimosi 7-314 spisel 7-324, 7-326, 7-327 spimiso 7-314 spread 7-380 spurious interrupt 4-41 spurious interrupt monitor 6-5, 6-8 sram 9-6, 9-41 sram banks 6-56 sram port size 6-75 s-records 7-169 stack frames 5-56 stack pointer 5-57, 5-72, 9-13 start transmit 7-320 state diagram 4-55 status register 5-56, 5-58 stb 7-333 stbi 7-333 stbo 7-333 stop transmit 7-120, 7-147, 7-175, 7- 204, 7-226, 7-250, 7-279, 7-297 stopped processing state 5-34 strategy 9-34 strobes 7-73, 7-88 sum check 7-210 supervisor data space 6-32 supervisor mode 9-13 switching protocols 7-141, 7-276 swiv 6-35 swsr 6-39 sync 6-67, 6-68 sync 7-115 syncclk 6-17, 7-67, 7-108 synchronization with the smsynx pin 7- 294 synchronization with the tsa 7-296 synchronous 4-21 synchronous mode 7-144 synchronous protocols 7-130 synchronous uart 7-158 sypcr 6-35 system configuration 6-5 system configuration and protection 6-3 system control instructions 5-25 system integration module 1-5, 6-1 system protection 9-15 t t1 7-116, 7-268 t1 line 1-15, 14 t1.605 7-190 ta 6-63, 6-66, 9-32 taddr 7-250 tag byte 7-245, 7-258 tbase 7-125, 7-271, 7-320 tbi 9-32 tbptr 7-127, 7-175, 7-274, 7-323 tck 2-12 tclk 7-101 tcn 7-22 tcp/ip 7-235 tcr 7-22 tdi 2-12 tdm 7-268, 7-358 tdm channels 7-170 tdm interface 1-15, 13 tdo 2-12
index motorola mc68356 user? manual index-21 ter 7-22 tfcr 7-125, 7-272, 7-321 tgate 7-19 tgcr 7-20 thermal characteristics 10-2 timeout 7-308 timer block diagram 7-17 timer examples 7-23 timers 7-17, 9-25 cascaded mode 7-19 deriving swt timeout 6-36 general-purpose timer 7-17 risc timer tables 7-11 timer block diagram 7-17 timer examples 7-23 tm_base 7-13 wake-up timer 7-151 time-slot 1-15, 14 tin 7-18 tm_base 7-13 tmr 7-21 tms 2-12 todr 7-121, 7-175, 7-200 totally transparent 7-220 tout 7-18 tp bit 5-49 tr bit 5-49, 5-51, 5-52, 5-53 trace 5-37, 5-39 trace exception 5-39, 5-42, 5-45, 5-46, 5- 49, 5-51, 5-56 trace mode 5-7 trace on instruction execution 5-59 transfer format 7-319 transition to bdm 5-62 transmission line configuration 7-194 transmit abort request command 7-307 transmit on demand 7-121 transmit/receive process 7-315 transmitter 7-275 transmitter shortcut 7-275 transmitting and receiving 7-208 transparent 7-115, 7-116, a-1 4-bit sync 7-223 achieving synchronization in transparent mode 7-223 external synchronization signals 7-223 in-line synchronization pattern 7-223 pip 7-338 promiscuous 7-220 scc transparent example 7-233 sending transparent frames between quiccs 7-225 smc 7-291 totally transparent 7-220 transparent channel frame reception processing 7-222 transparent channel frame transmission processing 7-221 transparent command set 7-226 transparent controller 7-220 transparent error-handling procedure 7-227 transparent receive buffer descriptor 7-228 transparent channel frame reception processing 7-222 transparent channel frame transmission processing 7-221 transparent command set 7-226, 7-297 transparent controller 7-220, 7-291 transparent crc 7-112 transparent error-handling procedure 7- 227, 7-298 transparent memory map 7-225 transparent mode register 7-228 transparent nmsi example 7-303 transparent protocol 7-268 transparent receive buffer descriptor 7- 228 transparent reception processing 7-293 transparent transmit buffer descriptor 7- 230 transparent tsa example 7-304 trap instruction 5-39 tris 2-12, 6-26 trlxq 6-74 trr 7-22 trst 2-12 ts 6-26, 6-60, 6-63, 6-68, 9-32 tsa 7-170 using the tsa 7-195 tsa transmission line configuration 7-195 txd 7-101, 7-358
index index-22 mc68356 user? manual motorola u uart 7-105, 7-114, 7-117, 7-118, 7-268, 7- 276, a-2 auto baud 7-166 break 7-166 break support 7-151 error-handling 7-154 fractional stop bits 7-153 idle status 7-167 max_idl 7-145 multidrop mode 7-149 normal asynchronous mode 7-144 parity enable 7-159 scc uart example 7-167 scc uart rx bd example 7-160 sending a preamble 7-153 smc 7-276 synchronous mode 7-144 synchronous uart 7-158 uart address recognition 7-149 uart character format 7-142 uart command set 7-147 uart control characters 7-150 uart controller 7-141 uart memory map 7-145 uart mode register 7-156 uart multidrop operation 7-150 uart programming model 7-147 xoff 7-152, 7-169 xon 7-152, 7-169 uart character format 7-142 uart command set 7-147, 7-279 uart controller 7-141 uart encoding/decoding 7-138 uart error-handling procedure 7-281 uart example 7-290 uart interrupt events example 7-165 uart key features 7-143 uart lan 1-11 uart memory map 7-145 uart mode register 7-156 uart multidrop operation 7-150 uart programming model 7-147, 7-279 uart receive buffer descriptor 7-159 uart reception 7-279 uart rx bd example 7-286 uart transmission 7-278 uart transmit buffer descriptor 7-163 unimplemented instructions 5-10, 5-44, 5- 59 unlk 5-9, 5-17, 5-34 user privilege level 5-7, 5-35 using the tsa 7-195 v v.120 7-91 v.14 7-158 vbr 9-14 vcc 2-13 vccclk 6-19 vccsyn 2-13, 6-19 vector software watchdog timer 6-9 vector base address 7-380 vector base register 5-4, 5-11, 5-36, 5-43, 5-72 w wait state 6-56, 6-67 wait states 4-26, 4-28 wake-up timer 7-151 watchdog timer 9-26 we 2-1, 2-9, 4-27, 6-48 word port 4-9, 4-14 write a/d register 5-70, 5-71 write cycle 4-26 write memory location 5-74 write pending buffer 5-83 write protect 6-56 write protection 6-71 write system register 5-72 x x.21 7-114 x.25 a-1, b-1, b-4 xfc 2-11, 6-19 xoff 7-152, 7-169 xon 7-152, 7-169 xtal 2-10, 2-11


▲Up To Search▲   

 
Price & Availability of MC68EN360CRC25

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X